Skip to content

Commit

Permalink
Changed back TypeReader. Changed Mechanism of Detecting of BaseDataVa…
Browse files Browse the repository at this point in the history
…riableType in ModelToJsonConverter.
  • Loading branch information
mdornaus authored and GoetzGoerisch committed Nov 28, 2023
1 parent 2e12b9d commit c8574df
Show file tree
Hide file tree
Showing 4 changed files with 458 additions and 389 deletions.
5 changes: 4 additions & 1 deletion DashboardClient/Converter/ModelToJson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

#include "ModelToJson.hpp"
#include "../../ModelOpcUa/src/ModelOpcUa/ModelInstance.hpp"
#include "../NodeIdsWellKnown.hpp"
#include <easylogging++.h>

namespace Umati {
Expand Down Expand Up @@ -99,7 +100,9 @@ ModelToJson::ModelToJson(

// TODO use another function to check for i=17570 aka AnalogUnitRangeType and i=2755 aka StateVariableType
// Set ofBaseDataVariableType somewhere?
bool ModelToJson::isBaseDataVariableType(const std::shared_ptr<const ModelOpcUa::SimpleNode> &pSimpleNode) { return pSimpleNode->ofBaseDataVariableType; }
bool ModelToJson::isBaseDataVariableType(const std::shared_ptr<const ModelOpcUa::SimpleNode> &pSimpleNode) {
return (pSimpleNode->NodeClass == ModelOpcUa::NodeClass_t::Variable || pSimpleNode->NodeClass == ModelOpcUa::NodeClass_t::VariableType) && !(pSimpleNode->NodeId == Umati::Dashboard::NodeId_PropertyType);
}

std::string ModelToJson::nodeClassToString(ModelOpcUa::NodeClass_t nodeClass) {
switch (nodeClass) {
Expand Down
3 changes: 2 additions & 1 deletion DashboardClient/NodeIdsWellKnown.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ namespace Umati
const ModelOpcUa::NodeId_t NodeId_HasTypeDefinition = {ns0Uri, "i=40"};
const ModelOpcUa::NodeId_t NodeId_HasInterface = {ns0Uri, "i=17603"};
const ModelOpcUa::NodeId_t NodeId_Organizes = {ns0Uri, "i=35"};
const ModelOpcUa::NodeId_t NodeId_BaseVariableType = {ns0Uri, "i=63"};
const ModelOpcUa::NodeId_t NodeId_BaseVariableType = {"", "i=63"};
const ModelOpcUa::NodeId_t NodeId_PropertyType = {"", "i=68"};
const ModelOpcUa::NodeId_t NodeId_BaseDataType {ns0Uri, "i=24"};
const ModelOpcUa::NodeId_t NodeId_Structure {ns0Uri, "i=22"};
const ModelOpcUa::NodeId_t NodeId_OPC_Binary {ns0Uri, "i=93"};
Expand Down
Loading

0 comments on commit c8574df

Please sign in to comment.