-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix(lint): Fix linter errors * Fix * fix
- Loading branch information
1 parent
c885f91
commit 7126e56
Showing
3 changed files
with
33 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,40 @@ | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
/* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. | ||
* | ||
* Copyright 2019-2021 (c) Christian von Arnim, ISW University of Stuttgart (for umati and VDW e.V.) | ||
* Copyright 2020 (c) Dominik Basner, Sotec GmbH (for VDW e.V.) | ||
* Copyright 2021 (c) Marius Dege, basysKom GmbH | ||
* Copyright 2023 (c) Sebastian Friedl, FVA GmbH interop4X | ||
* | ||
* Copyright (c) 2019-2021 Christian von Arnim, ISW University of Stuttgart (for umati and VDW e.V.) | ||
* Copyright (c) 2020 Dominik Basner, Sotec GmbH (for VDW e.V.) | ||
* Copyright (c) 2021 Marius Dege, basysKom GmbH | ||
* Copyright (c) 2023 Sebastian Friedl, FVA GmbH interop4X | ||
*/ | ||
|
||
#include "UaToModelConverter.hpp" | ||
#include <easylogging++.h> | ||
|
||
namespace Umati { | ||
namespace OpcUa { | ||
namespace Converter { | ||
|
||
UaToModelConverter::UaToModelConverter(const std::map<uint16_t, std::string> &idToUri) : m_idToUri( | ||
idToUri) { | ||
} | ||
namespace OpcUa { | ||
namespace Converter { | ||
|
||
UaToModelConverter::~UaToModelConverter() = default; | ||
UaToModelConverter::UaToModelConverter(const std::map<uint16_t, std::string> &idToUri) : m_idToUri(idToUri) {} | ||
|
||
UaToModelConverter::~UaToModelConverter() = default; | ||
|
||
std::string UaToModelConverter::getUriFromNsIndex(uint16_t nsIndex) { | ||
// the opc ua standard allows to remove the nsIndex for the namespace zero | ||
// so the converter only use this nsIndex | ||
if (nsIndex == 0) { | ||
return std::string(); | ||
} | ||
// FIX_END | ||
std::string UaToModelConverter::getUriFromNsIndex(uint16_t nsIndex) { | ||
// the opc ua standard allows to remove the nsIndex for the namespace zero | ||
// so the converter only use this nsIndex | ||
if (nsIndex == 0) { | ||
return std::string(); | ||
} | ||
// FIX_END | ||
|
||
auto it = m_idToUri.find(nsIndex); | ||
if (it == m_idToUri.end()) { | ||
LOG(ERROR) << "Could not find nsIndex: " << nsIndex << std::endl; | ||
return std::string(); | ||
} | ||
auto it = m_idToUri.find(nsIndex); | ||
if (it == m_idToUri.end()) { | ||
LOG(ERROR) << "Could not find nsIndex: " << nsIndex << std::endl; | ||
return std::string(); | ||
} | ||
|
||
return it->second; | ||
} | ||
} | ||
} | ||
return it->second; | ||
} | ||
} // namespace Converter | ||
} // namespace OpcUa | ||
} // namespace Umati |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters