Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding IEM-DCR module #1059

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
138 changes: 138 additions & 0 deletions modules/IsabellenhuetteIemDcr/.clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,138 @@
---
Language: Cpp
# BasedOnStyle: LLVM
AccessModifierOffset: -4
AlignAfterOpenBracket: Align
AlignConsecutiveMacros: true
AlignConsecutiveAssignments: false
AlignConsecutiveDeclarations: false
AlignEscapedNewlines: Right
AlignOperands: true
AlignTrailingComments: true
AllowAllArgumentsOnNextLine: true
AllowAllConstructorInitializersOnNextLine: true
AllowAllParametersOfDeclarationOnNextLine: true
AllowShortBlocksOnASingleLine: Never
AllowShortCaseLabelsOnASingleLine: false
AllowShortEnumsOnASingleLine: false
AllowShortFunctionsOnASingleLine: None
AllowShortLambdasOnASingleLine: All
AllowShortIfStatementsOnASingleLine: Never
AllowShortLoopsOnASingleLine: false
AlwaysBreakAfterDefinitionReturnType: None
AlwaysBreakAfterReturnType: None
AlwaysBreakBeforeMultilineStrings: false
AlwaysBreakTemplateDeclarations: MultiLine
BinPackArguments: true
BinPackParameters: true
BraceWrapping:
AfterCaseLabel: false
AfterClass: false
AfterControlStatement: false
AfterEnum: false
AfterFunction: false
AfterNamespace: false
AfterObjCDeclaration: false
AfterStruct: false
AfterUnion: false
AfterExternBlock: false
BeforeCatch: false
BeforeElse: false
IndentBraces: false
SplitEmptyFunction: true
SplitEmptyRecord: true
SplitEmptyNamespace: true
BreakBeforeBinaryOperators: None
BreakBeforeBraces: Attach
BreakBeforeInheritanceComma: false
BreakInheritanceList: BeforeColon
BreakBeforeTernaryOperators: true
BreakConstructorInitializersBeforeComma: false
BreakConstructorInitializers: AfterColon
BreakAfterJavaFieldAnnotations: false
BreakStringLiterals: true
ColumnLimit: 120
CommentPragmas: '^ IWYU pragma:'
CompactNamespaces: false
ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DeriveLineEnding: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true
ForEachMacros:
- foreach
- Q_FOREACH
- BOOST_FOREACH
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
- Regex: '.*'
Priority: 1
SortPriority: 0
IncludeIsMainRegex: '(Test)?$'
IncludeIsMainSourceRegex: ''
IndentCaseLabels: false
IndentGotoLabels: true
IndentPPDirectives: None
IndentWidth: 4
IndentWrappedFunctionNames: false
JavaScriptQuotes: Leave
JavaScriptWrapImports: true
KeepEmptyLinesAtTheStartOfBlocks: true
MacroBlockBegin: ''
MacroBlockEnd: ''
MaxEmptyLinesToKeep: 1
NamespaceIndentation: None
ObjCBinPackProtocolList: Auto
ObjCBlockIndentWidth: 2
ObjCSpaceAfterProperty: false
ObjCSpaceBeforeProtocolList: true
PenaltyBreakAssignment: 2
PenaltyBreakBeforeFirstCallParameter: 19
PenaltyBreakComment: 300
PenaltyBreakFirstLessLess: 120
PenaltyBreakString: 1000
PenaltyBreakTemplateDeclaration: 10
PenaltyExcessCharacter: 1000000
PenaltyReturnTypeOnItsOwnLine: 60
PointerAlignment: Left
ReflowComments: true
SortIncludes: true
SortUsingDeclarations: true
SpaceAfterCStyleCast: false
SpaceAfterLogicalNot: false
SpaceAfterTemplateKeyword: true
SpaceBeforeAssignmentOperators: true
SpaceBeforeCpp11BracedList: false
SpaceBeforeCtorInitializerColon: true
SpaceBeforeInheritanceColon: true
SpaceBeforeParens: ControlStatements
SpaceBeforeRangeBasedForLoopColon: true
SpaceInEmptyBlock: false
SpaceInEmptyParentheses: false
SpacesBeforeTrailingComments: 1
SpacesInAngles: false
SpacesInConditionalStatement: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false
SpaceBeforeSquareBrackets: false
Standard: Latest
StatementMacros:
- Q_UNUSED
- QT_REQUIRE_VERSION
TabWidth: 8
UseCRLF: false
UseTab: Never
...

43 changes: 43 additions & 0 deletions modules/IsabellenhuetteIemDcr/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"env": {
"browser": true,
"commonjs": true,
"es2021": true
},
"extends": [
"airbnb-base"
],
"parserOptions": {
"ecmaVersion": 12
},
"rules": {
"camelcase": "off",
"eqeqeq": [
"error",
"smart"
],
"comma-dangle": [
"warn",
{
"objects": "always-multiline",
"arrays": "always-multiline",
"functions": "never"
}
],
"import/no-unresolved": [
2,
{
"ignore": [
"everestjs"
]
}
],
"max-len": [
"warn",
{
"code": 120,
"tabWidth": 2
}
]
}
}
31 changes: 31 additions & 0 deletions modules/IsabellenhuetteIemDcr/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#
# AUTO GENERATED - MARKED REGIONS WILL BE KEPT
# template version 3
#

# module setup:
# - ${MODULE_NAME}: module name
ev_setup_cpp_module()

# ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1
# insert your custom targets and additional config variables here
target_link_libraries(${MODULE_NAME} PRIVATE
CURL::libcurl
nlohmann_json::nlohmann_json
)

target_sources(${MODULE_NAME}
PRIVATE
main/isabellenhuette_IemDcr_controller.cpp
main/http_client.cpp
)
# ev@bcc62523-e22b-41d7-ba2f-825b493a3c97:v1

target_sources(${MODULE_NAME}
PRIVATE
"main/powermeterImpl.cpp"
)

# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1
# insert other things like install cmds etc here
# ev@c55432ab-152c-45a9-9d2e-7281d50c69c3:v1
15 changes: 15 additions & 0 deletions modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Pionix GmbH and Contributors to EVerest
#include "IsabellenhuetteIemDcr.hpp"

namespace module {

void IsabellenhuetteIemDcr::init() {
invoke_init(*p_main);
}

void IsabellenhuetteIemDcr::ready() {
invoke_ready(*p_main);
}

} // namespace module
71 changes: 71 additions & 0 deletions modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
// SPDX-License-Identifier: Apache-2.0
// Copyright Pionix GmbH and Contributors to EVerest
#ifndef ISABELLENHUETTE_IEM_DCR_HPP
#define ISABELLENHUETTE_IEM_DCR_HPP

//
// AUTO GENERATED - MARKED REGIONS WILL BE KEPT
// template version 2
//

#include "ld-ev.hpp"

// headers for provided interface implementations
#include <generated/interfaces/powermeter/Implementation.hpp>

// ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1
// insert your custom include headers here
// ev@4bf81b14-a215-475c-a1d3-0a484ae48918:v1

namespace module {

struct Conf {
std::string ip_address;

Check notice on line 23 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L23

struct member 'Conf::ip_address' is never used.
int port_http;

Check notice on line 24 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L24

struct member 'Conf::port_http' is never used.
std::string timezone;

Check notice on line 25 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L25

struct member 'Conf::timezone' is never used.
int datetime_resync_interval;

Check notice on line 26 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L26

struct member 'Conf::datetime_resync_interval' is never used.
int resilience_initial_connection_retries;

Check notice on line 27 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L27

struct member 'Conf::resilience_initial_connection_retries' is never used.
int resilience_initial_connection_retry_delay;

Check notice on line 28 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L28

struct member 'Conf::resilience_initial_connection_retry_delay' is never used.
int resilience_transaction_request_retries;

Check notice on line 29 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L29

struct member 'Conf::resilience_transaction_request_retries' is never used.
int resilience_transaction_request_retry_delay;

Check notice on line 30 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L30

struct member 'Conf::resilience_transaction_request_retry_delay' is never used.
std::string CT;

Check notice on line 31 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L31

struct member 'Conf::CT' is never used.
std::string CI;
std::string TT_initial;

Check notice on line 33 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L33

struct member 'Conf::TT_initial' is never used.
bool US;

Check notice on line 34 in modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

modules/IsabellenhuetteIemDcr/IsabellenhuetteIemDcr.hpp#L34

struct member 'Conf::US' is never used.
};

class IsabellenhuetteIemDcr : public Everest::ModuleBase {
public:
IsabellenhuetteIemDcr() = delete;
IsabellenhuetteIemDcr(const ModuleInfo& info, std::unique_ptr<powermeterImplBase> p_main, Conf& config) :
ModuleBase(info), p_main(std::move(p_main)), config(config){};

const std::unique_ptr<powermeterImplBase> p_main;
const Conf& config;

// ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1
// insert your public definitions here
// ev@1fce4c5e-0ab8-41bb-90f7-14277703d2ac:v1

protected:
// ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1
// insert your protected definitions here
// ev@4714b2ab-a24f-4b95-ab81-36439e1478de:v1

private:
friend class LdEverest;
void init();
void ready();

// ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1
// insert your private definitions here
// ev@211cfdbe-f69a-4cd6-a4ec-f8aaa3d1b6c8:v1
};

// ev@087e516b-124c-48df-94fb-109508c7cda9:v1
// insert other definitions here
// ev@087e516b-124c-48df-94fb-109508c7cda9:v1

} // namespace module

#endif // ISABELLENHUETTE_IEM_DCR_HPP
Loading