From 40e577f856b3f19a1e8a4f5d7b3c10fe6f8ef178 Mon Sep 17 00:00:00 2001 From: Jeremie Chabod Date: Wed, 13 Dec 2023 15:20:12 +0100 Subject: [PATCH] Modify PIVOT to PIVOTTC and "opcua_operation" to "PivotCommand" Signed-off-by: Jeremie Chabod --- src/pivot2opcua_filter.cpp | 3 ++- tests/main_test_configs.h | 2 +- tests/test_filter.cpp | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/pivot2opcua_filter.cpp b/src/pivot2opcua_filter.cpp index 7207abb..5769278 100644 --- a/src/pivot2opcua_filter.cpp +++ b/src/pivot2opcua_filter.cpp @@ -902,7 +902,7 @@ Pivot2OpcuaFilter::opcua2pivot(Reading* reading)const { */ // The Value must be read before cleaning old datapoints! - Datapoint* pivot = createDatapoint("PIVOT"); + Datapoint* pivot = createDatapoint("PIVOTTC"); Datapoint* gtic = datapointAddElement(pivot, "GTIC"); datapointAddElementWithValue(gtic, "Select", co_se); datapointAddElementWithValue(gtic, "ComingFrom", "opcua"); @@ -949,6 +949,7 @@ Pivot2OpcuaFilter::ingest(ReadingSet *readingSet) { // proceed to conversion if (assetName == "opcua_operation") { opcua2pivot(reading); + reading->setAssetName("PivotCommand"); } else { // Default case convert PIVOT to OPCUA pivot2opcua(reading); diff --git a/tests/main_test_configs.h b/tests/main_test_configs.h index 81da7b4..39a30ed 100644 --- a/tests/main_test_configs.h +++ b/tests/main_test_configs.h @@ -228,7 +228,7 @@ inline DatapointValue* getRoResult(ReadingSet& rSet) { inline DatapointValue* getPivotResult(ReadingSet& rSet) { Datapoints& dp(rSet.getAllReadingsPtr()->back()->getReadingData()); - return get_datapoint_by_key(&dp, "PIVOT"); + return get_datapoint_by_key(&dp, "PIVOTTC"); } static uint32_t checkRoResult(Datapoints* dp, const string& id, int reply) { diff --git a/tests/test_filter.cpp b/tests/test_filter.cpp index 3f799ac..ac17441 100644 --- a/tests/test_filter.cpp +++ b/tests/test_filter.cpp @@ -1224,7 +1224,7 @@ TEST(Pivot2Opcua_Filter, Pivot2OpcuaFilterReply) { f_reset_outputs(); ASSERT_EQ(called_output_handle, nullptr); ASSERT_EQ(called_output_reading, nullptr); - TRACE(" * INGEST() /opcua_operation"); + TRACE(" * INGEST() /PivotCommand"); filter.ingest(&rSet); ASSERT_EQ(called_output_handle, &stubOutH); ASSERT_EQ(called_output_reading, &rSet);