diff --git a/CMakeLists.txt b/CMakeLists.txt index f47aa6a8..81d1e1c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,9 @@ # The version number. set(AGENT_VERSION_MAJOR 2) -set(AGENT_VERSION_MINOR 3) +set(AGENT_VERSION_MINOR 5) set(AGENT_VERSION_PATCH 0) -set(AGENT_VERSION_BUILD 5) -set(AGENT_VERSION_RC "") +set(AGENT_VERSION_BUILD 0) +set(AGENT_VERSION_RC "RC1") # This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent cmake_minimum_required(VERSION 3.23 FATAL_ERROR) diff --git a/agent/cppagent.cpp b/agent/cppagent.cpp index ae86382a..3557e01a 100644 --- a/agent/cppagent.cpp +++ b/agent/cppagent.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/agent_lib/CMakeLists.txt b/agent_lib/CMakeLists.txt index ac5763e4..fbbbd70c 100644 --- a/agent_lib/CMakeLists.txt +++ b/agent_lib/CMakeLists.txt @@ -183,6 +183,7 @@ set(AGENT_SOURCES "${SOURCE_DIR}/pipeline/topic_mapper.hpp" "${SOURCE_DIR}/pipeline/transform.hpp" "${SOURCE_DIR}/pipeline/upcase_value.hpp" + "${SOURCE_DIR}/pipeline/validator.hpp" # src/pipeline SOURCE_FILES_ONLY @@ -246,12 +247,12 @@ set(AGENT_SOURCES # src/sink/mqtt_sink HEADER_FILE_ONLY "${SOURCE_DIR}/sink/mqtt_sink/mqtt_service.hpp" - "${SOURCE_DIR}/sink/mqtt_sink/mqtt2_service.hpp" + "${SOURCE_DIR}/sink/mqtt_sink/mqtt2_service.hpp" #src/sink/mqtt_sink SOURCE_FILES_ONLY "${SOURCE_DIR}/sink/mqtt_sink/mqtt_service.cpp" - "${SOURCE_DIR}/sink/mqtt_sink/mqtt2_service.cpp" + "${SOURCE_DIR}/sink/mqtt_sink/mqtt2_service.cpp" # src/sink/rest_sink HEADER_FILE_ONLY @@ -273,6 +274,13 @@ set(AGENT_SOURCES "${SOURCE_DIR}/sink/rest_sink/rest_service.cpp" "${SOURCE_DIR}/sink/rest_sink/server.cpp" "${SOURCE_DIR}/sink/rest_sink/session_impl.cpp" + + # validation HEADER_FILES_ONLY + "${SOURCE_DIR}/validation/observations.hpp" + "${SOURCE_DIR}/validation/observation_validations.hpp" + + # validation SOURCE_FILES_ONLY + "${SOURCE_DIR}/validation/observations.cpp" ) if(WITH_RUBY) diff --git a/src/mtconnect/agent.cpp b/src/mtconnect/agent.cpp index 592af871..a2eaa939 100644 --- a/src/mtconnect/agent.cpp +++ b/src/mtconnect/agent.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -58,6 +58,8 @@ #include "mtconnect/utilities.hpp" #include "mtconnect/version.h" +#include "mtconnect/validation/observations.hpp" + using namespace std; namespace mtconnect { @@ -83,7 +85,8 @@ namespace mtconnect { m_deviceXmlPath(deviceXmlPath), m_circularBuffer(GetOption(options, config::BufferSize).value_or(17), GetOption(options, config::CheckpointFrequency).value_or(1000)), - m_pretty(IsOptionSet(options, mtconnect::configuration::Pretty)) + m_pretty(IsOptionSet(options, mtconnect::configuration::Pretty)), + m_validation(IsOptionSet(options, mtconnect::configuration::Validation)) { using namespace asset; @@ -104,8 +107,8 @@ namespace mtconnect { uint32_t(GetOption(options, mtconnect::configuration::JsonVersion).value_or(2)); // Create the Printers - m_printers["xml"] = make_unique(m_pretty); - m_printers["json"] = make_unique(jsonVersion, m_pretty); + m_printers["xml"] = make_unique(m_pretty, m_validation); + m_printers["json"] = make_unique(jsonVersion, m_pretty, m_validation); if (m_schemaVersion) { @@ -168,6 +171,13 @@ namespace mtconnect { if (!m_observationsInitialized) { + if (m_intSchemaVersion < SCHEMA_VERSION(2, 5) && IsOptionSet(m_options, mtconnect::configuration::Validation)) + { + m_validation = false; + for (auto &printer : m_printers) + printer.second->setValidation(false); + } + for (auto device : m_deviceIndex) initializeDataItems(device); @@ -191,6 +201,7 @@ namespace mtconnect { } m_observationsInitialized = true; + } } diff --git a/src/mtconnect/agent.hpp b/src/mtconnect/agent.hpp index a3202f3c..e1425dcc 100644 --- a/src/mtconnect/agent.hpp +++ b/src/mtconnect/agent.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -542,6 +542,9 @@ namespace mtconnect { // For debugging bool m_pretty; + // validation + bool m_validation {false}; + // Agent hooks configuration::HookManager m_beforeInitializeHooks; configuration::HookManager m_afterInitializeHooks; diff --git a/src/mtconnect/asset/asset.cpp b/src/mtconnect/asset/asset.cpp index ecda782d..ac51d0cd 100644 --- a/src/mtconnect/asset/asset.cpp +++ b/src/mtconnect/asset/asset.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/asset.hpp b/src/mtconnect/asset/asset.hpp index 0fe001a2..182186c8 100644 --- a/src/mtconnect/asset/asset.hpp +++ b/src/mtconnect/asset/asset.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/asset_buffer.hpp b/src/mtconnect/asset/asset_buffer.hpp index b4aa75bf..66278074 100644 --- a/src/mtconnect/asset/asset_buffer.hpp +++ b/src/mtconnect/asset/asset_buffer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/asset_storage.hpp b/src/mtconnect/asset/asset_storage.hpp index dcccae64..ff90e49a 100644 --- a/src/mtconnect/asset/asset_storage.hpp +++ b/src/mtconnect/asset/asset_storage.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/component_configuration_parameters.cpp b/src/mtconnect/asset/component_configuration_parameters.cpp index 10065267..d341b6d8 100644 --- a/src/mtconnect/asset/component_configuration_parameters.cpp +++ b/src/mtconnect/asset/component_configuration_parameters.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/component_configuration_parameters.hpp b/src/mtconnect/asset/component_configuration_parameters.hpp index ef45675f..fc40d344 100644 --- a/src/mtconnect/asset/component_configuration_parameters.hpp +++ b/src/mtconnect/asset/component_configuration_parameters.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/cutting_tool.cpp b/src/mtconnect/asset/cutting_tool.cpp index 579350bc..43d5303a 100644 --- a/src/mtconnect/asset/cutting_tool.cpp +++ b/src/mtconnect/asset/cutting_tool.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/cutting_tool.hpp b/src/mtconnect/asset/cutting_tool.hpp index 1c3e820c..7eec093e 100644 --- a/src/mtconnect/asset/cutting_tool.hpp +++ b/src/mtconnect/asset/cutting_tool.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/file_asset.cpp b/src/mtconnect/asset/file_asset.cpp index 222b97f9..b001c86c 100644 --- a/src/mtconnect/asset/file_asset.cpp +++ b/src/mtconnect/asset/file_asset.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/file_asset.hpp b/src/mtconnect/asset/file_asset.hpp index 380f26bc..9c5ea979 100644 --- a/src/mtconnect/asset/file_asset.hpp +++ b/src/mtconnect/asset/file_asset.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/qif_document.cpp b/src/mtconnect/asset/qif_document.cpp index bf7b7791..6c762cd1 100644 --- a/src/mtconnect/asset/qif_document.cpp +++ b/src/mtconnect/asset/qif_document.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/qif_document.hpp b/src/mtconnect/asset/qif_document.hpp index e1c58fcf..45bc7f2f 100644 --- a/src/mtconnect/asset/qif_document.hpp +++ b/src/mtconnect/asset/qif_document.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/raw_material.cpp b/src/mtconnect/asset/raw_material.cpp index a9a44d3f..0ca15b37 100644 --- a/src/mtconnect/asset/raw_material.cpp +++ b/src/mtconnect/asset/raw_material.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/asset/raw_material.hpp b/src/mtconnect/asset/raw_material.hpp index 2612ed5d..76af8d85 100644 --- a/src/mtconnect/asset/raw_material.hpp +++ b/src/mtconnect/asset/raw_material.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/buffer/checkpoint.cpp b/src/mtconnect/buffer/checkpoint.cpp index a0e32f6e..fd5ec303 100644 --- a/src/mtconnect/buffer/checkpoint.cpp +++ b/src/mtconnect/buffer/checkpoint.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/buffer/checkpoint.hpp b/src/mtconnect/buffer/checkpoint.hpp index 7e7c582a..b830c223 100644 --- a/src/mtconnect/buffer/checkpoint.hpp +++ b/src/mtconnect/buffer/checkpoint.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/buffer/circular_buffer.hpp b/src/mtconnect/buffer/circular_buffer.hpp index e9b934ae..eb3b3f4d 100644 --- a/src/mtconnect/buffer/circular_buffer.hpp +++ b/src/mtconnect/buffer/circular_buffer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/config.hpp b/src/mtconnect/config.hpp index 219d245d..a522fe12 100644 --- a/src/mtconnect/config.hpp +++ b/src/mtconnect/config.hpp @@ -1,7 +1,7 @@ #pragma once // -// Copyright Copyright 2009-2022, AMT � The Association For Manufacturing Technology (�AMT�) +// Copyright Copyright 2009-2024, AMT � The Association For Manufacturing Technology (�AMT�) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/agent_config.cpp b/src/mtconnect/configuration/agent_config.cpp index 80174ad8..bd134930 100644 --- a/src/mtconnect/configuration/agent_config.cpp +++ b/src/mtconnect/configuration/agent_config.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -789,7 +789,8 @@ namespace mtconnect::configuration { {configuration::TlsVerifyClientCertificate, false}, {configuration::TlsClientCAs, ""s}, {configuration::SuppressIPAddress, false}, - {configuration::AllowPutFrom, ""s}}); + {configuration::AllowPutFrom, ""s}, + {configuration::Validation, false}}); m_workerThreadCount = *GetOption(options, configuration::WorkerThreads); m_monitorFiles = *GetOption(options, configuration::MonitorConfigFiles); diff --git a/src/mtconnect/configuration/agent_config.hpp b/src/mtconnect/configuration/agent_config.hpp index 61b39bbd..dd68f198 100644 --- a/src/mtconnect/configuration/agent_config.hpp +++ b/src/mtconnect/configuration/agent_config.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/async_context.hpp b/src/mtconnect/configuration/async_context.hpp index 0446685e..47b05d2b 100644 --- a/src/mtconnect/configuration/async_context.hpp +++ b/src/mtconnect/configuration/async_context.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/config_options.hpp b/src/mtconnect/configuration/config_options.hpp index ac5bb2d3..35f33ce5 100644 --- a/src/mtconnect/configuration/config_options.hpp +++ b/src/mtconnect/configuration/config_options.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -76,6 +76,7 @@ namespace mtconnect { DECLARE_CONFIGURATION(VersionDeviceXml); DECLARE_CONFIGURATION(EnableSourceDeviceModels); DECLARE_CONFIGURATION(WorkerThreads); + DECLARE_CONFIGURATION(Validation); ///@} /// @name MQTT Configuration diff --git a/src/mtconnect/configuration/hook_manager.hpp b/src/mtconnect/configuration/hook_manager.hpp index 4c62cc04..d831146c 100644 --- a/src/mtconnect/configuration/hook_manager.hpp +++ b/src/mtconnect/configuration/hook_manager.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/parser.cpp b/src/mtconnect/configuration/parser.cpp index e145441d..2baeb8e1 100644 --- a/src/mtconnect/configuration/parser.cpp +++ b/src/mtconnect/configuration/parser.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/parser.hpp b/src/mtconnect/configuration/parser.hpp index 63fe41c3..13d9bb0d 100644 --- a/src/mtconnect/configuration/parser.hpp +++ b/src/mtconnect/configuration/parser.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/service.cpp b/src/mtconnect/configuration/service.cpp index b9669dba..58ed3068 100644 --- a/src/mtconnect/configuration/service.cpp +++ b/src/mtconnect/configuration/service.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/configuration/service.hpp b/src/mtconnect/configuration/service.hpp index b61b67a8..fca63e1e 100644 --- a/src/mtconnect/configuration/service.hpp +++ b/src/mtconnect/configuration/service.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/agent_device.cpp b/src/mtconnect/device_model/agent_device.cpp index ef6df602..dc2e6c6a 100644 --- a/src/mtconnect/device_model/agent_device.cpp +++ b/src/mtconnect/device_model/agent_device.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/agent_device.hpp b/src/mtconnect/device_model/agent_device.hpp index 6bbe3455..4b693b5e 100644 --- a/src/mtconnect/device_model/agent_device.hpp +++ b/src/mtconnect/device_model/agent_device.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/component.cpp b/src/mtconnect/device_model/component.cpp index 4935edda..779bccc1 100644 --- a/src/mtconnect/device_model/component.cpp +++ b/src/mtconnect/device_model/component.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/component.hpp b/src/mtconnect/device_model/component.hpp index ca0c09d4..911b7a5a 100644 --- a/src/mtconnect/device_model/component.hpp +++ b/src/mtconnect/device_model/component.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/composition.cpp b/src/mtconnect/device_model/composition.cpp index 923938b3..40f57cd2 100644 --- a/src/mtconnect/device_model/composition.cpp +++ b/src/mtconnect/device_model/composition.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/composition.hpp b/src/mtconnect/device_model/composition.hpp index 3ad2046c..97bdad4c 100644 --- a/src/mtconnect/device_model/composition.hpp +++ b/src/mtconnect/device_model/composition.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/configuration.cpp b/src/mtconnect/device_model/configuration/configuration.cpp index 4f0a5119..44cbcaa7 100644 --- a/src/mtconnect/device_model/configuration/configuration.cpp +++ b/src/mtconnect/device_model/configuration/configuration.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/configuration.hpp b/src/mtconnect/device_model/configuration/configuration.hpp index f9f70739..dc01d1f3 100644 --- a/src/mtconnect/device_model/configuration/configuration.hpp +++ b/src/mtconnect/device_model/configuration/configuration.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/coordinate_systems.cpp b/src/mtconnect/device_model/configuration/coordinate_systems.cpp index d5b96a92..adc9be6f 100644 --- a/src/mtconnect/device_model/configuration/coordinate_systems.cpp +++ b/src/mtconnect/device_model/configuration/coordinate_systems.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/coordinate_systems.hpp b/src/mtconnect/device_model/configuration/coordinate_systems.hpp index ea414c33..8fdc819f 100644 --- a/src/mtconnect/device_model/configuration/coordinate_systems.hpp +++ b/src/mtconnect/device_model/configuration/coordinate_systems.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/image_file.cpp b/src/mtconnect/device_model/configuration/image_file.cpp index 29d6b9a4..84be05aa 100644 --- a/src/mtconnect/device_model/configuration/image_file.cpp +++ b/src/mtconnect/device_model/configuration/image_file.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/image_file.hpp b/src/mtconnect/device_model/configuration/image_file.hpp index 32448fbe..6aac7f61 100644 --- a/src/mtconnect/device_model/configuration/image_file.hpp +++ b/src/mtconnect/device_model/configuration/image_file.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/motion.cpp b/src/mtconnect/device_model/configuration/motion.cpp index a5ecd818..5a863a44 100644 --- a/src/mtconnect/device_model/configuration/motion.cpp +++ b/src/mtconnect/device_model/configuration/motion.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/motion.hpp b/src/mtconnect/device_model/configuration/motion.hpp index ec73c9c2..1594e309 100644 --- a/src/mtconnect/device_model/configuration/motion.hpp +++ b/src/mtconnect/device_model/configuration/motion.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/relationships.cpp b/src/mtconnect/device_model/configuration/relationships.cpp index bcfba65c..a2ed6d78 100644 --- a/src/mtconnect/device_model/configuration/relationships.cpp +++ b/src/mtconnect/device_model/configuration/relationships.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/relationships.hpp b/src/mtconnect/device_model/configuration/relationships.hpp index 62eeb75a..c2a6fb46 100644 --- a/src/mtconnect/device_model/configuration/relationships.hpp +++ b/src/mtconnect/device_model/configuration/relationships.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/sensor_configuration.cpp b/src/mtconnect/device_model/configuration/sensor_configuration.cpp index b82abae6..2bb26ecd 100644 --- a/src/mtconnect/device_model/configuration/sensor_configuration.cpp +++ b/src/mtconnect/device_model/configuration/sensor_configuration.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/sensor_configuration.hpp b/src/mtconnect/device_model/configuration/sensor_configuration.hpp index 8a4c54b5..8eeb25b6 100644 --- a/src/mtconnect/device_model/configuration/sensor_configuration.hpp +++ b/src/mtconnect/device_model/configuration/sensor_configuration.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/solid_model.cpp b/src/mtconnect/device_model/configuration/solid_model.cpp index e2341a7f..6c96236b 100644 --- a/src/mtconnect/device_model/configuration/solid_model.cpp +++ b/src/mtconnect/device_model/configuration/solid_model.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/solid_model.hpp b/src/mtconnect/device_model/configuration/solid_model.hpp index 71d60bcf..fa406d9a 100644 --- a/src/mtconnect/device_model/configuration/solid_model.hpp +++ b/src/mtconnect/device_model/configuration/solid_model.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/specifications.cpp b/src/mtconnect/device_model/configuration/specifications.cpp index fe74c894..a4d55bc0 100644 --- a/src/mtconnect/device_model/configuration/specifications.cpp +++ b/src/mtconnect/device_model/configuration/specifications.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/configuration/specifications.hpp b/src/mtconnect/device_model/configuration/specifications.hpp index 90da6bc3..226af76a 100644 --- a/src/mtconnect/device_model/configuration/specifications.hpp +++ b/src/mtconnect/device_model/configuration/specifications.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/constraints.hpp b/src/mtconnect/device_model/data_item/constraints.hpp index e6b91988..21c36295 100644 --- a/src/mtconnect/device_model/data_item/constraints.hpp +++ b/src/mtconnect/device_model/data_item/constraints.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/data_item.cpp b/src/mtconnect/device_model/data_item/data_item.cpp index df8d5c33..f65e2238 100644 --- a/src/mtconnect/device_model/data_item/data_item.cpp +++ b/src/mtconnect/device_model/data_item/data_item.cpp @@ -1,6 +1,6 @@ // // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/data_item.hpp b/src/mtconnect/device_model/data_item/data_item.hpp index 6c4a7803..1337cd74 100644 --- a/src/mtconnect/device_model/data_item/data_item.hpp +++ b/src/mtconnect/device_model/data_item/data_item.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/definition.hpp b/src/mtconnect/device_model/data_item/definition.hpp index 69a5d0b5..f1ba7245 100644 --- a/src/mtconnect/device_model/data_item/definition.hpp +++ b/src/mtconnect/device_model/data_item/definition.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/filter.hpp b/src/mtconnect/device_model/data_item/filter.hpp index 0d32733f..779f6d3c 100644 --- a/src/mtconnect/device_model/data_item/filter.hpp +++ b/src/mtconnect/device_model/data_item/filter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/relationships.hpp b/src/mtconnect/device_model/data_item/relationships.hpp index 47bc187d..10c34c8c 100644 --- a/src/mtconnect/device_model/data_item/relationships.hpp +++ b/src/mtconnect/device_model/data_item/relationships.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/source.hpp b/src/mtconnect/device_model/data_item/source.hpp index 561aaa38..e0895282 100644 --- a/src/mtconnect/device_model/data_item/source.hpp +++ b/src/mtconnect/device_model/data_item/source.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/unit_conversion.cpp b/src/mtconnect/device_model/data_item/unit_conversion.cpp index 84201a88..26c853c0 100644 --- a/src/mtconnect/device_model/data_item/unit_conversion.cpp +++ b/src/mtconnect/device_model/data_item/unit_conversion.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/data_item/unit_conversion.hpp b/src/mtconnect/device_model/data_item/unit_conversion.hpp index c20fd515..068a43aa 100644 --- a/src/mtconnect/device_model/data_item/unit_conversion.hpp +++ b/src/mtconnect/device_model/data_item/unit_conversion.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/description.cpp b/src/mtconnect/device_model/description.cpp index fe999e94..9a7c1cb4 100644 --- a/src/mtconnect/device_model/description.cpp +++ b/src/mtconnect/device_model/description.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/description.hpp b/src/mtconnect/device_model/description.hpp index c6c5059d..8789eba6 100644 --- a/src/mtconnect/device_model/description.hpp +++ b/src/mtconnect/device_model/description.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/device.cpp b/src/mtconnect/device_model/device.cpp index bdfed3bd..e427c02b 100644 --- a/src/mtconnect/device_model/device.cpp +++ b/src/mtconnect/device_model/device.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/device.hpp b/src/mtconnect/device_model/device.hpp index b811fd79..d4ae2a80 100644 --- a/src/mtconnect/device_model/device.hpp +++ b/src/mtconnect/device_model/device.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/reference.cpp b/src/mtconnect/device_model/reference.cpp index c58bb23d..bc48b32f 100644 --- a/src/mtconnect/device_model/reference.cpp +++ b/src/mtconnect/device_model/reference.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/device_model/reference.hpp b/src/mtconnect/device_model/reference.hpp index bb91d55e..ba9595a5 100644 --- a/src/mtconnect/device_model/reference.hpp +++ b/src/mtconnect/device_model/reference.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT � The Association For Manufacturing Technology (�AMT�) +// Copyright Copyright 2009-2024, AMT � The Association For Manufacturing Technology (�AMT�) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/data_set.cpp b/src/mtconnect/entity/data_set.cpp index 598d5b81..016f5c30 100644 --- a/src/mtconnect/entity/data_set.cpp +++ b/src/mtconnect/entity/data_set.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/data_set.hpp b/src/mtconnect/entity/data_set.hpp index 1602efb4..0fdaa598 100644 --- a/src/mtconnect/entity/data_set.hpp +++ b/src/mtconnect/entity/data_set.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/entity.cpp b/src/mtconnect/entity/entity.cpp index 777eb306..99e0b409 100644 --- a/src/mtconnect/entity/entity.cpp +++ b/src/mtconnect/entity/entity.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/entity.hpp b/src/mtconnect/entity/entity.hpp index b56eec38..8f45cd31 100644 --- a/src/mtconnect/entity/entity.hpp +++ b/src/mtconnect/entity/entity.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/factory.cpp b/src/mtconnect/entity/factory.cpp index 0d1b24ea..e763accd 100644 --- a/src/mtconnect/entity/factory.cpp +++ b/src/mtconnect/entity/factory.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/factory.hpp b/src/mtconnect/entity/factory.hpp index 5b19c0c9..b5e1d411 100644 --- a/src/mtconnect/entity/factory.hpp +++ b/src/mtconnect/entity/factory.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/json_parser.cpp b/src/mtconnect/entity/json_parser.cpp index 03db5f97..3976d2fb 100644 --- a/src/mtconnect/entity/json_parser.cpp +++ b/src/mtconnect/entity/json_parser.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT The Association For Manufacturing Technology (AMT) +// Copyright Copyright 2009-2024, AMT The Association For Manufacturing Technology (AMT) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/json_parser.hpp b/src/mtconnect/entity/json_parser.hpp index 90f2bb01..2fa29a0b 100644 --- a/src/mtconnect/entity/json_parser.hpp +++ b/src/mtconnect/entity/json_parser.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT � The Association For Manufacturing Technology (�AMT�) +// Copyright Copyright 2009-2024, AMT � The Association For Manufacturing Technology (�AMT�) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/json_printer.hpp b/src/mtconnect/entity/json_printer.hpp index 24e9629a..424b7617 100644 --- a/src/mtconnect/entity/json_printer.hpp +++ b/src/mtconnect/entity/json_printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/qname.hpp b/src/mtconnect/entity/qname.hpp index 44970840..c2c5b9ed 100644 --- a/src/mtconnect/entity/qname.hpp +++ b/src/mtconnect/entity/qname.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/requirement.cpp b/src/mtconnect/entity/requirement.cpp index e93c7bcc..854fd7e1 100644 --- a/src/mtconnect/entity/requirement.cpp +++ b/src/mtconnect/entity/requirement.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/requirement.hpp b/src/mtconnect/entity/requirement.hpp index 92c57f34..a4a9832b 100644 --- a/src/mtconnect/entity/requirement.hpp +++ b/src/mtconnect/entity/requirement.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/xml_parser.cpp b/src/mtconnect/entity/xml_parser.cpp index 8fb2c63f..9c7a37f7 100644 --- a/src/mtconnect/entity/xml_parser.cpp +++ b/src/mtconnect/entity/xml_parser.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/xml_parser.hpp b/src/mtconnect/entity/xml_parser.hpp index 8e66a5f3..d771dc86 100644 --- a/src/mtconnect/entity/xml_parser.hpp +++ b/src/mtconnect/entity/xml_parser.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/xml_printer.cpp b/src/mtconnect/entity/xml_printer.cpp index 97dd96ab..799cf256 100644 --- a/src/mtconnect/entity/xml_printer.cpp +++ b/src/mtconnect/entity/xml_printer.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/entity/xml_printer.hpp b/src/mtconnect/entity/xml_printer.hpp index 9d556bbf..23a8aa5d 100644 --- a/src/mtconnect/entity/xml_printer.hpp +++ b/src/mtconnect/entity/xml_printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/logging.hpp b/src/mtconnect/logging.hpp index 0d21a757..5e2d613f 100644 --- a/src/mtconnect/logging.hpp +++ b/src/mtconnect/logging.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/mqtt/mqtt_authorization.hpp b/src/mtconnect/mqtt/mqtt_authorization.hpp index 08105aa2..73c79ace 100644 --- a/src/mtconnect/mqtt/mqtt_authorization.hpp +++ b/src/mtconnect/mqtt/mqtt_authorization.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/mqtt/mqtt_client.hpp b/src/mtconnect/mqtt/mqtt_client.hpp index d1245848..70c61404 100644 --- a/src/mtconnect/mqtt/mqtt_client.hpp +++ b/src/mtconnect/mqtt/mqtt_client.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/mqtt/mqtt_client_impl.hpp b/src/mtconnect/mqtt/mqtt_client_impl.hpp index dc1747d4..0a20377d 100644 --- a/src/mtconnect/mqtt/mqtt_client_impl.hpp +++ b/src/mtconnect/mqtt/mqtt_client_impl.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/mqtt/mqtt_server.hpp b/src/mtconnect/mqtt/mqtt_server.hpp index 55a0ccf2..8d38700a 100644 --- a/src/mtconnect/mqtt/mqtt_server.hpp +++ b/src/mtconnect/mqtt/mqtt_server.hpp @@ -1,5 +1,5 @@ -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. diff --git a/src/mtconnect/mqtt/mqtt_server_impl.hpp b/src/mtconnect/mqtt/mqtt_server_impl.hpp index 13bd773b..4c3b0571 100644 --- a/src/mtconnect/mqtt/mqtt_server_impl.hpp +++ b/src/mtconnect/mqtt/mqtt_server_impl.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/observation/change_observer.cpp b/src/mtconnect/observation/change_observer.cpp index bdf4143e..88b5c5da 100644 --- a/src/mtconnect/observation/change_observer.cpp +++ b/src/mtconnect/observation/change_observer.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/observation/change_observer.hpp b/src/mtconnect/observation/change_observer.hpp index f08ca61a..3f4e5c2e 100644 --- a/src/mtconnect/observation/change_observer.hpp +++ b/src/mtconnect/observation/change_observer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/observation/observation.cpp b/src/mtconnect/observation/observation.cpp index 2a6c33dd..fc8c5628 100644 --- a/src/mtconnect/observation/observation.cpp +++ b/src/mtconnect/observation/observation.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -41,15 +41,18 @@ namespace mtconnect { static FactoryPtr factory; if (!factory) { - factory = make_shared(Requirements({{"dataItemId", true}, - {"timestamp", ValueType::TIMESTAMP, true}, - {"sequence", false}, - {"subType", false}, - {"name", false}, - {"compositionId", false}}), - [](const std::string &name, Properties &props) -> EntityPtr { - return make_shared(name, props); - }); + factory = make_shared( + Requirements({{"dataItemId", true}, + {"timestamp", ValueType::TIMESTAMP, true}, + {"sequence", false}, + {"subType", false}, + {"name", false}, + {"compositionId", false}, + {"quality", ControlledVocab {"VALID", "INVALID", "UNVERIFIABLE"}, false}, + {"deprecated", ValueType::BOOL, false}}), + [](const std::string &name, Properties &props) -> EntityPtr { + return make_shared(name, props); + }); factory->registerFactory("Events:Message", Message::getFactory()); factory->registerFactory("Events:MessageDiscrete", Message::getFactory()); diff --git a/src/mtconnect/observation/observation.hpp b/src/mtconnect/observation/observation.hpp index ffc0f3d0..bc2e4853 100644 --- a/src/mtconnect/observation/observation.hpp +++ b/src/mtconnect/observation/observation.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/parser/xml_parser.cpp b/src/mtconnect/parser/xml_parser.cpp index 14b4199c..6485ecfe 100644 --- a/src/mtconnect/parser/xml_parser.cpp +++ b/src/mtconnect/parser/xml_parser.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/parser/xml_parser.hpp b/src/mtconnect/parser/xml_parser.hpp index eff7ac9c..e5747c98 100644 --- a/src/mtconnect/parser/xml_parser.hpp +++ b/src/mtconnect/parser/xml_parser.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/convert_sample.hpp b/src/mtconnect/pipeline/convert_sample.hpp index 854109bb..90dc9e90 100644 --- a/src/mtconnect/pipeline/convert_sample.hpp +++ b/src/mtconnect/pipeline/convert_sample.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/deliver.cpp b/src/mtconnect/pipeline/deliver.cpp index 19f390ea..bdaa044c 100644 --- a/src/mtconnect/pipeline/deliver.cpp +++ b/src/mtconnect/pipeline/deliver.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/deliver.hpp b/src/mtconnect/pipeline/deliver.hpp index 47e615b2..f48b4508 100644 --- a/src/mtconnect/pipeline/deliver.hpp +++ b/src/mtconnect/pipeline/deliver.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/delta_filter.hpp b/src/mtconnect/pipeline/delta_filter.hpp index d84a8084..313f92e4 100644 --- a/src/mtconnect/pipeline/delta_filter.hpp +++ b/src/mtconnect/pipeline/delta_filter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/duplicate_filter.hpp b/src/mtconnect/pipeline/duplicate_filter.hpp index 21f5e49d..c9fbf09d 100644 --- a/src/mtconnect/pipeline/duplicate_filter.hpp +++ b/src/mtconnect/pipeline/duplicate_filter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/guard.hpp b/src/mtconnect/pipeline/guard.hpp index 43bf83a2..98cb89dc 100644 --- a/src/mtconnect/pipeline/guard.hpp +++ b/src/mtconnect/pipeline/guard.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/json_mapper.cpp b/src/mtconnect/pipeline/json_mapper.cpp index b81214d5..7bf8dbc1 100644 --- a/src/mtconnect/pipeline/json_mapper.cpp +++ b/src/mtconnect/pipeline/json_mapper.cpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/json_mapper.hpp b/src/mtconnect/pipeline/json_mapper.hpp index e2c75dcb..d437a6b5 100644 --- a/src/mtconnect/pipeline/json_mapper.hpp +++ b/src/mtconnect/pipeline/json_mapper.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/message_mapper.hpp b/src/mtconnect/pipeline/message_mapper.hpp index 9588e446..7f84e078 100644 --- a/src/mtconnect/pipeline/message_mapper.hpp +++ b/src/mtconnect/pipeline/message_mapper.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/mtconnect_xml_transform.hpp b/src/mtconnect/pipeline/mtconnect_xml_transform.hpp index 4236cd46..26991333 100644 --- a/src/mtconnect/pipeline/mtconnect_xml_transform.hpp +++ b/src/mtconnect/pipeline/mtconnect_xml_transform.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/period_filter.hpp b/src/mtconnect/pipeline/period_filter.hpp index 4d282638..9073e855 100644 --- a/src/mtconnect/pipeline/period_filter.hpp +++ b/src/mtconnect/pipeline/period_filter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -127,7 +127,7 @@ namespace mtconnect::pipeline { } } - return next(obs); + return next(std::move(obs)); } protected: diff --git a/src/mtconnect/pipeline/pipeline.hpp b/src/mtconnect/pipeline/pipeline.hpp index 1ee84923..c16b9e33 100644 --- a/src/mtconnect/pipeline/pipeline.hpp +++ b/src/mtconnect/pipeline/pipeline.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/pipeline_context.hpp b/src/mtconnect/pipeline/pipeline_context.hpp index bd451f15..42e55b55 100644 --- a/src/mtconnect/pipeline/pipeline_context.hpp +++ b/src/mtconnect/pipeline/pipeline_context.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/pipeline_contract.hpp b/src/mtconnect/pipeline/pipeline_contract.hpp index 4de67eb1..ace30352 100644 --- a/src/mtconnect/pipeline/pipeline_contract.hpp +++ b/src/mtconnect/pipeline/pipeline_contract.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/response_document.cpp b/src/mtconnect/pipeline/response_document.cpp index aaa1b406..419d4e6e 100644 --- a/src/mtconnect/pipeline/response_document.cpp +++ b/src/mtconnect/pipeline/response_document.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/response_document.hpp b/src/mtconnect/pipeline/response_document.hpp index 1a915f00..f6101652 100644 --- a/src/mtconnect/pipeline/response_document.hpp +++ b/src/mtconnect/pipeline/response_document.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/shdr_token_mapper.cpp b/src/mtconnect/pipeline/shdr_token_mapper.cpp index 3a65ceab..a7bc983e 100644 --- a/src/mtconnect/pipeline/shdr_token_mapper.cpp +++ b/src/mtconnect/pipeline/shdr_token_mapper.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/shdr_token_mapper.hpp b/src/mtconnect/pipeline/shdr_token_mapper.hpp index 23f45a9d..f12c192d 100644 --- a/src/mtconnect/pipeline/shdr_token_mapper.hpp +++ b/src/mtconnect/pipeline/shdr_token_mapper.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/shdr_tokenizer.hpp b/src/mtconnect/pipeline/shdr_tokenizer.hpp index 5512d7ca..a9c3d31f 100644 --- a/src/mtconnect/pipeline/shdr_tokenizer.hpp +++ b/src/mtconnect/pipeline/shdr_tokenizer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/timestamp_extractor.hpp b/src/mtconnect/pipeline/timestamp_extractor.hpp index 48ceb602..4164e8fe 100644 --- a/src/mtconnect/pipeline/timestamp_extractor.hpp +++ b/src/mtconnect/pipeline/timestamp_extractor.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/topic_mapper.hpp b/src/mtconnect/pipeline/topic_mapper.hpp index 3d006771..7aa52887 100644 --- a/src/mtconnect/pipeline/topic_mapper.hpp +++ b/src/mtconnect/pipeline/topic_mapper.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/transform.hpp b/src/mtconnect/pipeline/transform.hpp index 917237bc..6fbf9d3a 100644 --- a/src/mtconnect/pipeline/transform.hpp +++ b/src/mtconnect/pipeline/transform.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/upcase_value.hpp b/src/mtconnect/pipeline/upcase_value.hpp index b95bb24a..fae0d1a4 100644 --- a/src/mtconnect/pipeline/upcase_value.hpp +++ b/src/mtconnect/pipeline/upcase_value.hpp @@ -1,4 +1,4 @@ -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/pipeline/validator.hpp b/src/mtconnect/pipeline/validator.hpp new file mode 100644 index 00000000..3524d03d --- /dev/null +++ b/src/mtconnect/pipeline/validator.hpp @@ -0,0 +1,109 @@ +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#pragma once + +#include +#include + +#include "mtconnect/config.hpp" +#include "mtconnect/entity/entity.hpp" +#include "mtconnect/observation/observation.hpp" +#include "mtconnect/validation/observations.hpp" +#include "transform.hpp" + +namespace mtconnect::pipeline { + using namespace entity; + + /// @brief Map a token list to data items or asset types + class AGENT_LIB_API Validator : public Transform + { + public: + Validator(const Validator &) = default; + Validator(PipelineContextPtr context) + : Transform("Validator"), + m_contract(context->m_contract.get()) + { + m_guard = TypeGuard(RUN) || TypeGuard(SKIP); + } + + EntityPtr operator()(entity::EntityPtr &&entity) override + { + using namespace observation; + using namespace mtconnect::validation::observations; + auto evt = std::dynamic_pointer_cast(entity); + + auto di = evt->getDataItem(); + auto &type = di->getType(); + auto &value = evt->getValue(); + + if (value == "UNAVAILABLE") + { + evt->setProperty("quality", std::string("VALID")); + } + else + { + // Optimize + auto vocab = ControlledVocabularies.find(type); + if (vocab != ControlledVocabularies.end()) + { + auto &lits = vocab->second; + if (lits.size() != 0) + { + auto lit = lits.find(value); + if (lit != lits.end()) + { + evt->setProperty("quality", std::string("VALID")); + // Check for deprecated + } + else + { + evt->setProperty("quality", std::string("INVALID")); + // Log once + auto &id = di->getId(); + if (m_logOnce.count(id) < 1) + { + LOG(warning) << id << ": Invalid value for '" << type << "' " << evt->getValue(); + m_logOnce.insert(id); + } + else + { + LOG(trace) << id << ": Invalid value for '" << type << "' " << evt->getValue(); + + } + } + } + else + { + evt->setProperty("quality", std::string("VALID")); + } + } + else + { + evt->setProperty("quality", std::string("UNVERIFIABLE")); + } + } + + return next(std::move(evt)); + } + + protected: + // Logging Context + std::set m_logOnce; + PipelineContract *m_contract; + std::unordered_map m_dataItemMap; + }; +} // namespace mtconnect::pipeline diff --git a/src/mtconnect/printer/json_printer.cpp b/src/mtconnect/printer/json_printer.cpp index 1108d087..2720d5ea 100644 --- a/src/mtconnect/printer/json_printer.cpp +++ b/src/mtconnect/printer/json_printer.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -47,8 +47,8 @@ namespace mtconnect::printer { using namespace device_model; using namespace rapidjson; - JsonPrinter::JsonPrinter(uint32_t jsonVersion, bool pretty) - : Printer(pretty), m_jsonVersion(jsonVersion) + JsonPrinter::JsonPrinter(uint32_t jsonVersion, bool pretty, bool validation) + : Printer(pretty, validation), m_jsonVersion(jsonVersion) { NAMED_SCOPE("JsonPrinter::JsonPrinter"); char appVersion[32] = {0}; @@ -60,7 +60,8 @@ namespace mtconnect::printer { template inline void header(AutoJsonObject &obj, const string &version, const string &hostname, const uint64_t instanceId, const unsigned int bufferSize, - const string &schemaVersion, const string modelChangeTime) + const string &schemaVersion, const string modelChangeTime, + bool validation) { obj.AddPairs("version", version, "creationTime", getCurrentTime(GMT), "testIndicator", false, "instanceId", instanceId, "sender", hostname, "schemaVersion", schemaVersion); @@ -69,6 +70,9 @@ namespace mtconnect::printer { obj.AddPairs("deviceModelChangeTime", modelChangeTime); if (bufferSize > 0) obj.AddPairs("bufferSize", bufferSize); + if (validation) + obj.AddPairs("validation", true); + } template @@ -76,9 +80,10 @@ namespace mtconnect::printer { const string &hostname, const uint64_t instanceId, const unsigned int bufferSize, const unsigned int assetBufferSize, const unsigned int assetCount, const string &schemaVersion, - const string modelChangeTime) + const string modelChangeTime, + const bool validation) { - header(obj, version, hostname, instanceId, bufferSize, schemaVersion, modelChangeTime); + header(obj, version, hostname, instanceId, bufferSize, schemaVersion, modelChangeTime, validation); obj.AddPairs("assetBufferSize", assetBufferSize, "assetCount", assetCount); } @@ -87,9 +92,10 @@ namespace mtconnect::printer { const uint64_t instanceId, const unsigned int bufferSize, const uint64_t nextSequence, const uint64_t firstSequence, const uint64_t lastSequence, const string &schemaVersion, - const string modelChangeTime) + const string modelChangeTime, + const bool validation) { - header(obj, version, hostname, instanceId, bufferSize, schemaVersion, modelChangeTime); + header(obj, version, hostname, instanceId, bufferSize, schemaVersion, modelChangeTime, validation); obj.AddPairs("nextSequence", nextSequence, "lastSequence", lastSequence, "firstSequence", firstSequence); } @@ -123,7 +129,7 @@ namespace mtconnect::printer { { AutoJsonObject obj(writer, "Header"); header(obj, m_version, m_senderName, instanceId, bufferSize, *m_schemaVersion, - m_modelChangeTime); + m_modelChangeTime, m_validation); } { if (m_jsonVersion > 1) @@ -180,7 +186,7 @@ namespace mtconnect::printer { { AutoJsonObject obj(writer, "Header"); probeAssetHeader(obj, m_version, m_senderName, instanceId, bufferSize, assetBufferSize, - assetCount, *m_schemaVersion, m_modelChangeTime); + assetCount, *m_schemaVersion, m_modelChangeTime, m_validation); } { obj.Key("Devices"); @@ -207,7 +213,8 @@ namespace mtconnect::printer { { AutoJsonObject obj(writer, "Header"); probeAssetHeader(obj, m_version, m_senderName, instanceId, 0, bufferSize, assetCount, - *m_schemaVersion, m_modelChangeTime); + *m_schemaVersion, m_modelChangeTime, + m_validation); } { obj.Key("Assets"); @@ -405,7 +412,8 @@ namespace mtconnect::printer { { AutoJsonObject obj(writer, "Header"); streamHeader(obj, m_version, m_senderName, instanceId, bufferSize, nextSeq, firstSeq, - lastSeq, *m_schemaVersion, m_modelChangeTime); + lastSeq, *m_schemaVersion, m_modelChangeTime, + m_validation); } { diff --git a/src/mtconnect/printer/json_printer.hpp b/src/mtconnect/printer/json_printer.hpp index 2a1e4ea9..fd392133 100644 --- a/src/mtconnect/printer/json_printer.hpp +++ b/src/mtconnect/printer/json_printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,7 +27,7 @@ namespace mtconnect::printer { class AGENT_LIB_API JsonPrinter : public Printer { public: - JsonPrinter(uint32_t jsonVersion, bool pretty = false); + JsonPrinter(uint32_t jsonVersion, bool pretty = false, bool validation = false); ~JsonPrinter() override = default; std::string printErrors(const uint64_t instanceId, const unsigned int bufferSize, diff --git a/src/mtconnect/printer/json_printer_helper.hpp b/src/mtconnect/printer/json_printer_helper.hpp index e8bb39b0..61b843e3 100644 --- a/src/mtconnect/printer/json_printer_helper.hpp +++ b/src/mtconnect/printer/json_printer_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/printer/printer.hpp b/src/mtconnect/printer/printer.hpp index cfc0bd27..4e39cb0a 100644 --- a/src/mtconnect/printer/printer.hpp +++ b/src/mtconnect/printer/printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -49,7 +49,7 @@ namespace mtconnect { public: /// @brief construct a printer /// @param pretty `true` if content should be pretty printed - Printer(bool pretty = false) : m_pretty(pretty) {} + Printer(bool pretty = false, bool validation = false) : m_pretty(pretty), m_validation(validation) {} virtual ~Printer() = default; /// @brief Generate an MTConnect Error document @@ -145,9 +145,19 @@ namespace mtconnect { const_cast(this)->m_schemaVersion.emplace(ver); } } + + /// @brief Get validation header flag state + /// @returns validation state + bool getValidation() const { return m_validation; } + + /// @brief sets validation state + /// @param validation the validation state + void setValidation(bool v) { m_validation = v; } + protected: - bool m_pretty; + bool m_pretty; //< Turns pretty printing on + bool m_validation; //< Sets validation flag in header std::string m_modelChangeTime; std::optional m_schemaVersion; std::string m_senderName {"localhost"}; diff --git a/src/mtconnect/printer/xml_helper.hpp b/src/mtconnect/printer/xml_helper.hpp index 94eac2d2..e1758ae5 100644 --- a/src/mtconnect/printer/xml_helper.hpp +++ b/src/mtconnect/printer/xml_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/printer/xml_printer.cpp b/src/mtconnect/printer/xml_printer.cpp index 915193d6..6448959e 100644 --- a/src/mtconnect/printer/xml_printer.cpp +++ b/src/mtconnect/printer/xml_printer.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -100,7 +100,7 @@ namespace mtconnect::printer { xmlBufferPtr m_buf; }; - XmlPrinter::XmlPrinter(bool pretty) : Printer(pretty) { NAMED_SCOPE("xml.printer"); } + XmlPrinter::XmlPrinter(bool pretty, bool validation) : Printer(pretty, validation) { NAMED_SCOPE("xml.printer"); } void XmlPrinter::addDevicesNamespace(const std::string &urn, const std::string &location, const std::string &prefix) @@ -636,6 +636,9 @@ namespace mtconnect::printer { addAttribute(writer, "sender", m_senderName); addAttribute(writer, "instanceId", to_string(instanceId)); + + if (m_validation) + addAttribute(writer, "validation", "true"s); char version[32] = {0}; sprintf(version, "%d.%d.%d.%d", AGENT_VERSION_MAJOR, AGENT_VERSION_MINOR, AGENT_VERSION_PATCH, diff --git a/src/mtconnect/printer/xml_printer.hpp b/src/mtconnect/printer/xml_printer.hpp index bb4e0c2d..781a297c 100644 --- a/src/mtconnect/printer/xml_printer.hpp +++ b/src/mtconnect/printer/xml_printer.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -40,7 +40,7 @@ namespace mtconnect { class AGENT_LIB_API XmlPrinter : public Printer { public: - XmlPrinter(bool pretty = false); + XmlPrinter(bool pretty = false, bool validation = false); ~XmlPrinter() override = default; std::string printErrors(const uint64_t instanceId, const unsigned int bufferSize, diff --git a/src/mtconnect/printer/xml_printer_helper.hpp b/src/mtconnect/printer/xml_printer_helper.hpp index 64eab3aa..3ac60e91 100644 --- a/src/mtconnect/printer/xml_printer_helper.hpp +++ b/src/mtconnect/printer/xml_printer_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/embedded.cpp b/src/mtconnect/ruby/embedded.cpp index 6c5538cc..4942b688 100644 --- a/src/mtconnect/ruby/embedded.cpp +++ b/src/mtconnect/ruby/embedded.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/embedded.hpp b/src/mtconnect/ruby/embedded.hpp index 7caec310..38a5a110 100644 --- a/src/mtconnect/ruby/embedded.hpp +++ b/src/mtconnect/ruby/embedded.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_agent.hpp b/src/mtconnect/ruby/ruby_agent.hpp index 00da26c5..954fff2d 100644 --- a/src/mtconnect/ruby/ruby_agent.hpp +++ b/src/mtconnect/ruby/ruby_agent.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_entity.hpp b/src/mtconnect/ruby/ruby_entity.hpp index 6ba90509..6302afe4 100644 --- a/src/mtconnect/ruby/ruby_entity.hpp +++ b/src/mtconnect/ruby/ruby_entity.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_observation.hpp b/src/mtconnect/ruby/ruby_observation.hpp index a4158621..df0dec96 100644 --- a/src/mtconnect/ruby/ruby_observation.hpp +++ b/src/mtconnect/ruby/ruby_observation.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_pipeline.hpp b/src/mtconnect/ruby/ruby_pipeline.hpp index beb10a3c..0e1bf531 100644 --- a/src/mtconnect/ruby/ruby_pipeline.hpp +++ b/src/mtconnect/ruby/ruby_pipeline.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_smart_ptr.hpp b/src/mtconnect/ruby/ruby_smart_ptr.hpp index 97e34f3d..a8c23106 100644 --- a/src/mtconnect/ruby/ruby_smart_ptr.hpp +++ b/src/mtconnect/ruby/ruby_smart_ptr.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_transform.hpp b/src/mtconnect/ruby/ruby_transform.hpp index 4dc9c4cd..94693b29 100644 --- a/src/mtconnect/ruby/ruby_transform.hpp +++ b/src/mtconnect/ruby/ruby_transform.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_type.hpp b/src/mtconnect/ruby/ruby_type.hpp index 34641cd3..087b0e8f 100644 --- a/src/mtconnect/ruby/ruby_type.hpp +++ b/src/mtconnect/ruby/ruby_type.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/ruby/ruby_vm.hpp b/src/mtconnect/ruby/ruby_vm.hpp index d33134ba..39267a2e 100644 --- a/src/mtconnect/ruby/ruby_vm.hpp +++ b/src/mtconnect/ruby/ruby_vm.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/mqtt_sink/mqtt_service.cpp b/src/mtconnect/sink/mqtt_sink/mqtt_service.cpp index 6a2f54e5..b28b72d0 100644 --- a/src/mtconnect/sink/mqtt_sink/mqtt_service.cpp +++ b/src/mtconnect/sink/mqtt_sink/mqtt_service.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/mqtt_sink/mqtt_service.hpp b/src/mtconnect/sink/mqtt_sink/mqtt_service.hpp index 3b89b2ce..e94d01f5 100644 --- a/src/mtconnect/sink/mqtt_sink/mqtt_service.hpp +++ b/src/mtconnect/sink/mqtt_sink/mqtt_service.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/cached_file.hpp b/src/mtconnect/sink/rest_sink/cached_file.hpp index da2ca52f..40efea4f 100644 --- a/src/mtconnect/sink/rest_sink/cached_file.hpp +++ b/src/mtconnect/sink/rest_sink/cached_file.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/file_cache.cpp b/src/mtconnect/sink/rest_sink/file_cache.cpp index d230a490..07d31e18 100644 --- a/src/mtconnect/sink/rest_sink/file_cache.cpp +++ b/src/mtconnect/sink/rest_sink/file_cache.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/file_cache.hpp b/src/mtconnect/sink/rest_sink/file_cache.hpp index 5ee445a7..f5125ccd 100644 --- a/src/mtconnect/sink/rest_sink/file_cache.hpp +++ b/src/mtconnect/sink/rest_sink/file_cache.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/parameter.hpp b/src/mtconnect/sink/rest_sink/parameter.hpp index 9eea8fee..cb2879c3 100644 --- a/src/mtconnect/sink/rest_sink/parameter.hpp +++ b/src/mtconnect/sink/rest_sink/parameter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/request.hpp b/src/mtconnect/sink/rest_sink/request.hpp index f62f37db..ebff0602 100644 --- a/src/mtconnect/sink/rest_sink/request.hpp +++ b/src/mtconnect/sink/rest_sink/request.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/response.hpp b/src/mtconnect/sink/rest_sink/response.hpp index f8ae3c98..a67bdbe6 100644 --- a/src/mtconnect/sink/rest_sink/response.hpp +++ b/src/mtconnect/sink/rest_sink/response.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/rest_service.cpp b/src/mtconnect/sink/rest_sink/rest_service.cpp index 6e123ed8..9237a464 100644 --- a/src/mtconnect/sink/rest_sink/rest_service.cpp +++ b/src/mtconnect/sink/rest_sink/rest_service.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/rest_service.hpp b/src/mtconnect/sink/rest_sink/rest_service.hpp index 3e8091cb..51505fd5 100644 --- a/src/mtconnect/sink/rest_sink/rest_service.hpp +++ b/src/mtconnect/sink/rest_sink/rest_service.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/routing.hpp b/src/mtconnect/sink/rest_sink/routing.hpp index 10d852a9..ca8bdf38 100644 --- a/src/mtconnect/sink/rest_sink/routing.hpp +++ b/src/mtconnect/sink/rest_sink/routing.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/server.cpp b/src/mtconnect/sink/rest_sink/server.cpp index 93b387e1..7071c02e 100644 --- a/src/mtconnect/sink/rest_sink/server.cpp +++ b/src/mtconnect/sink/rest_sink/server.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/server.hpp b/src/mtconnect/sink/rest_sink/server.hpp index 07c5c4b5..d72fd176 100644 --- a/src/mtconnect/sink/rest_sink/server.hpp +++ b/src/mtconnect/sink/rest_sink/server.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/session.hpp b/src/mtconnect/sink/rest_sink/session.hpp index a6443f78..c4ed9041 100644 --- a/src/mtconnect/sink/rest_sink/session.hpp +++ b/src/mtconnect/sink/rest_sink/session.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/session_impl.cpp b/src/mtconnect/sink/rest_sink/session_impl.cpp index 93aae58f..43b3cbde 100644 --- a/src/mtconnect/sink/rest_sink/session_impl.cpp +++ b/src/mtconnect/sink/rest_sink/session_impl.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/session_impl.hpp b/src/mtconnect/sink/rest_sink/session_impl.hpp index 404d25b9..539c3ece 100644 --- a/src/mtconnect/sink/rest_sink/session_impl.hpp +++ b/src/mtconnect/sink/rest_sink/session_impl.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/rest_sink/tls_dector.hpp b/src/mtconnect/sink/rest_sink/tls_dector.hpp index 197e9a91..cf806589 100644 --- a/src/mtconnect/sink/rest_sink/tls_dector.hpp +++ b/src/mtconnect/sink/rest_sink/tls_dector.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/sink.cpp b/src/mtconnect/sink/sink.cpp index 4fb75748..1a65d10f 100644 --- a/src/mtconnect/sink/sink.cpp +++ b/src/mtconnect/sink/sink.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/sink/sink.hpp b/src/mtconnect/sink/sink.hpp index 1e517284..c06d0e1c 100644 --- a/src/mtconnect/sink/sink.hpp +++ b/src/mtconnect/sink/sink.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/adapter.hpp b/src/mtconnect/source/adapter/adapter.hpp index f27ffc03..7052d6d8 100644 --- a/src/mtconnect/source/adapter/adapter.hpp +++ b/src/mtconnect/source/adapter/adapter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/adapter_pipeline.cpp b/src/mtconnect/source/adapter/adapter_pipeline.cpp index 741cabdf..615b4741 100644 --- a/src/mtconnect/source/adapter/adapter_pipeline.cpp +++ b/src/mtconnect/source/adapter/adapter_pipeline.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -28,6 +28,7 @@ #include "mtconnect/pipeline/timestamp_extractor.hpp" #include "mtconnect/pipeline/topic_mapper.hpp" #include "mtconnect/pipeline/upcase_value.hpp" +#include "mtconnect/pipeline/validator.hpp" #include "mtconnect/source/adapter/adapter.hpp" using namespace std; @@ -138,6 +139,10 @@ namespace mtconnect { // Convert values if (IsOptionSet(m_options, configuration::ConversionRequired)) next = next->bind(make_shared()); + + // Validate Values + if (IsOptionSet(m_options, configuration::Validation)) + next = next->bind(make_shared(m_context)); // Filter dups, by delta, and by period next = next->bind(make_shared(m_context)); diff --git a/src/mtconnect/source/adapter/adapter_pipeline.hpp b/src/mtconnect/source/adapter/adapter_pipeline.hpp index 3d6155d8..a21ac3ce 100644 --- a/src/mtconnect/source/adapter/adapter_pipeline.hpp +++ b/src/mtconnect/source/adapter/adapter_pipeline.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/agent_adapter.cpp b/src/mtconnect/source/adapter/agent_adapter/agent_adapter.cpp index a38db70a..8845bbed 100644 --- a/src/mtconnect/source/adapter/agent_adapter/agent_adapter.cpp +++ b/src/mtconnect/source/adapter/agent_adapter/agent_adapter.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/agent_adapter.hpp b/src/mtconnect/source/adapter/agent_adapter/agent_adapter.hpp index e949654a..b7c60800 100644 --- a/src/mtconnect/source/adapter/agent_adapter/agent_adapter.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/agent_adapter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/http_session.hpp b/src/mtconnect/source/adapter/agent_adapter/http_session.hpp index 1003a2cd..2bb06364 100644 --- a/src/mtconnect/source/adapter/agent_adapter/http_session.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/http_session.hpp @@ -1,6 +1,6 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/https_session.hpp b/src/mtconnect/source/adapter/agent_adapter/https_session.hpp index 0b5b0ad3..4875b06c 100644 --- a/src/mtconnect/source/adapter/agent_adapter/https_session.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/https_session.hpp @@ -1,6 +1,6 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/session.hpp b/src/mtconnect/source/adapter/agent_adapter/session.hpp index 89e14682..5edf9698 100644 --- a/src/mtconnect/source/adapter/agent_adapter/session.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/session.hpp @@ -1,6 +1,6 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/session_impl.hpp b/src/mtconnect/source/adapter/agent_adapter/session_impl.hpp index 43ff13e5..3cfba36d 100644 --- a/src/mtconnect/source/adapter/agent_adapter/session_impl.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/session_impl.hpp @@ -1,6 +1,6 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/url_parser.cpp b/src/mtconnect/source/adapter/agent_adapter/url_parser.cpp index b6c3bb17..1932cd94 100644 --- a/src/mtconnect/source/adapter/agent_adapter/url_parser.cpp +++ b/src/mtconnect/source/adapter/agent_adapter/url_parser.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/agent_adapter/url_parser.hpp b/src/mtconnect/source/adapter/agent_adapter/url_parser.hpp index b14fd0da..62e1300c 100644 --- a/src/mtconnect/source/adapter/agent_adapter/url_parser.hpp +++ b/src/mtconnect/source/adapter/agent_adapter/url_parser.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/mqtt/mqtt_adapter.cpp b/src/mtconnect/source/adapter/mqtt/mqtt_adapter.cpp index de1399a0..7765ef2f 100644 --- a/src/mtconnect/source/adapter/mqtt/mqtt_adapter.cpp +++ b/src/mtconnect/source/adapter/mqtt/mqtt_adapter.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -123,7 +123,7 @@ namespace mtconnect { !IsOptionSet(m_options, configuration::MqttWs)) { m_client = make_shared(m_ioContext, m_options, - move(clientHandler)); + std::move(clientHandler)); } else if (IsOptionSet(m_options, configuration::MqttWs) && IsOptionSet(m_options, configuration::MqttTls)) diff --git a/src/mtconnect/source/adapter/mqtt/mqtt_adapter.hpp b/src/mtconnect/source/adapter/mqtt/mqtt_adapter.hpp index 6d017ad0..66e2554a 100644 --- a/src/mtconnect/source/adapter/mqtt/mqtt_adapter.hpp +++ b/src/mtconnect/source/adapter/mqtt/mqtt_adapter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/shdr/connector.cpp b/src/mtconnect/source/adapter/shdr/connector.cpp index 216d4c89..fb7f5979 100644 --- a/src/mtconnect/source/adapter/shdr/connector.cpp +++ b/src/mtconnect/source/adapter/shdr/connector.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/shdr/connector.hpp b/src/mtconnect/source/adapter/shdr/connector.hpp index 638c0e9d..d8cd727a 100644 --- a/src/mtconnect/source/adapter/shdr/connector.hpp +++ b/src/mtconnect/source/adapter/shdr/connector.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/shdr/shdr_adapter.cpp b/src/mtconnect/source/adapter/shdr/shdr_adapter.cpp index d3c685ab..a96e27c5 100644 --- a/src/mtconnect/source/adapter/shdr/shdr_adapter.cpp +++ b/src/mtconnect/source/adapter/shdr/shdr_adapter.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/shdr/shdr_adapter.hpp b/src/mtconnect/source/adapter/shdr/shdr_adapter.hpp index d04519a2..4b40f514 100644 --- a/src/mtconnect/source/adapter/shdr/shdr_adapter.hpp +++ b/src/mtconnect/source/adapter/shdr/shdr_adapter.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/shdr/shdr_pipeline.cpp b/src/mtconnect/source/adapter/shdr/shdr_pipeline.cpp index 2a2f6d55..45116061 100644 --- a/src/mtconnect/source/adapter/shdr/shdr_pipeline.cpp +++ b/src/mtconnect/source/adapter/shdr/shdr_pipeline.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/adapter/shdr/shdr_pipeline.hpp b/src/mtconnect/source/adapter/shdr/shdr_pipeline.hpp index 5962834f..f975ee4f 100644 --- a/src/mtconnect/source/adapter/shdr/shdr_pipeline.hpp +++ b/src/mtconnect/source/adapter/shdr/shdr_pipeline.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/error_code.hpp b/src/mtconnect/source/error_code.hpp index 32f7b4bd..af3164bb 100644 --- a/src/mtconnect/source/error_code.hpp +++ b/src/mtconnect/source/error_code.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/loopback_source.cpp b/src/mtconnect/source/loopback_source.cpp index 9befdcf1..c28609b4 100644 --- a/src/mtconnect/source/loopback_source.cpp +++ b/src/mtconnect/source/loopback_source.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); @@ -27,6 +27,7 @@ #include "mtconnect/pipeline/period_filter.hpp" #include "mtconnect/pipeline/timestamp_extractor.hpp" #include "mtconnect/pipeline/upcase_value.hpp" +#include "mtconnect/pipeline/validator.hpp" using namespace std; @@ -36,6 +37,8 @@ namespace mtconnect::source { using namespace pipeline; void LoopbackPipeline::build(const ConfigOptions &options) { + m_options = options; + clear(); TransformPtr next = m_start; @@ -54,6 +57,10 @@ namespace mtconnect::source { if (IsOptionSet(m_options, configuration::ConversionRequired)) next = next->bind(make_shared()); + // Validate Values + if (IsOptionSet(m_options, configuration::Validation)) + next = next->bind(make_shared(m_context)); + // Deliver next->bind(make_shared(m_context)); applySplices(); diff --git a/src/mtconnect/source/loopback_source.hpp b/src/mtconnect/source/loopback_source.hpp index cd396e04..42734c07 100644 --- a/src/mtconnect/source/loopback_source.hpp +++ b/src/mtconnect/source/loopback_source.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/source.cpp b/src/mtconnect/source/source.cpp index 5cc0322c..eb1f8c59 100644 --- a/src/mtconnect/source/source.cpp +++ b/src/mtconnect/source/source.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/source/source.hpp b/src/mtconnect/source/source.hpp index cdacfb9f..4debdafb 100644 --- a/src/mtconnect/source/source.hpp +++ b/src/mtconnect/source/source.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/utilities.cpp b/src/mtconnect/utilities.cpp index 898daf40..e36bd2f5 100644 --- a/src/mtconnect/utilities.cpp +++ b/src/mtconnect/utilities.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/utilities.hpp b/src/mtconnect/utilities.hpp index 8f668b44..87e0110a 100644 --- a/src/mtconnect/utilities.hpp +++ b/src/mtconnect/utilities.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/src/mtconnect/validation/observation_validations.hpp b/src/mtconnect/validation/observation_validations.hpp new file mode 100644 index 00000000..d0bb08ab --- /dev/null +++ b/src/mtconnect/validation/observation_validations.hpp @@ -0,0 +1,139 @@ +const Validation ControlledVocabularies { + {"ACTIVE_AXES", {}}, + {"ACTUATOR_STATE", {{"ACTIVE", 0}, {"INACTIVE", 0}}}, + {"ALARM", {}}, + {"ASSET_CHANGED", {}}, + {"ASSET_REMOVED", {}}, + {"AVAILABILITY", {{"AVAILABLE", 0}, {"UNAVAILABLE", 0}}}, + {"AXIS_COUPLING", {{"TANDEM", 0}, {"SYNCHRONOUS", 0}, {"MASTER", 0}, {"SLAVE", 0}}}, + {"AXIS_FEEDRATE_OVERRIDE", {}}, + {"AXIS_INTERLOCK", {{"ACTIVE", 0}, {"INACTIVE", 0}}}, + {"AXIS_STATE", {{"HOME", 0}, {"TRAVEL", 0}, {"PARKED", 0}, {"STOPPED", 0}}}, + {"BLOCK", {}}, + {"BLOCK_COUNT", {}}, + {"CHUCK_INTERLOCK", {{"ACTIVE", 0}, {"INACTIVE", 0}}}, + {"CHUCK_STATE", {{"OPEN", 0}, {"CLOSED", 0}, {"UNLATCHED", 0}}}, + {"CODE", {}}, + {"COMPOSITION_STATE", {}}, + {"CONTROLLER_MODE", {{"AUTOMATIC", 0}, {"MANUAL", 0}, {"MANUAL_DATA_INPUT", 0}, {"SEMI_AUTOMATIC", 0}, {"EDIT", 0}, {"FEED_HOLD", SCHEMA_VERSION(1, 3)}}}, + {"CONTROLLER_MODE_OVERRIDE", {{"ON", 0}, {"OFF", 0}}}, + {"COUPLED_AXES", {}}, + {"DATE_CODE", {}}, + {"DEVICE_UUID", {}}, + {"DIRECTION", {{"CLOCKWISE", SCHEMA_VERSION(1, 4)}, {"COUNTER_CLOCKWISE", SCHEMA_VERSION(1, 4)}, {"POSITIVE", SCHEMA_VERSION(1, 4)}, {"NEGATIVE", SCHEMA_VERSION(1, 4)}}}, + {"DOOR_STATE", {{"OPEN", 0}, {"CLOSED", 0}, {"UNLATCHED", 0}}}, + {"EMERGENCY_STOP", {{"ARMED", 0}, {"TRIGGERED", 0}}}, + {"END_OF_BAR", {{"YES", 0}, {"NO", 0}}}, + {"EQUIPMENT_MODE", {{"ON", 0}, {"OFF", 0}}}, + {"EXECUTION", {{"READY", 0}, {"ACTIVE", 0}, {"INTERRUPTED", 0}, {"FEED_HOLD", 0}, {"STOPPED", 0}, {"OPTIONAL_STOP", 0}, {"PROGRAM_STOPPED", 0}, {"PROGRAM_COMPLETED", 0}, {"WAIT", 0}, {"PROGRAM_OPTIONAL_STOP", SCHEMA_VERSION(1, 4)}}}, + {"FUNCTIONAL_MODE", {{"PRODUCTION", 0}, {"SETUP", 0}, {"TEARDOWN", 0}, {"MAINTENANCE", 0}, {"PROCESS_DEVELOPMENT", 0}}}, + {"HARDNESS", {}}, + {"LINE", {}}, + {"LINE_LABEL", {}}, + {"LINE_NUMBER", {}}, + {"MATERIAL", {}}, + {"MATERIAL_LAYER", {}}, + {"MESSAGE", {}}, + {"OPERATOR_ID", {}}, + {"PALLET_ID", {}}, + {"PART_COUNT", {}}, + {"PART_DETECT", {{"PRESENT", 0}, {"NOT_PRESENT", 0}}}, + {"PART_ID", {}}, + {"PART_NUMBER", {}}, + {"PATH_FEEDRATE_OVERRIDE", {}}, + {"PATH_MODE", {{"INDEPENDENT", 0}, {"MASTER", 0}, {"SYNCHRONOUS", 0}, {"MIRROR", 0}}}, + {"POWER_STATE", {{"ON", 0}, {"OFF", 0}}}, + {"POWER_STATUS", {{"ON", SCHEMA_VERSION(1, 1)}, {"OFF", SCHEMA_VERSION(1, 1)}}}, + {"PROCESS_TIME", {}}, + {"PROGRAM", {}}, + {"PROGRAM_COMMENT", {}}, + {"PROGRAM_EDIT", {{"ACTIVE", 0}, {"READY", 0}, {"NOT_READY", 0}}}, + {"PROGRAM_EDIT_NAME", {}}, + {"PROGRAM_HEADER", {}}, + {"PROGRAM_LOCATION", {}}, + {"PROGRAM_LOCATION_TYPE", {{"LOCAL", 0}, {"EXTERNAL", 0}}}, + {"PROGRAM_NEST_LEVEL", {}}, + {"ROTARY_MODE", {{"SPINDLE", 0}, {"INDEX", 0}, {"CONTOUR", 0}}}, + {"ROTARY_VELOCITY_OVERRIDE", {}}, + {"SERIAL_NUMBER", {}}, + {"SPINDLE_INTERLOCK", {{"ACTIVE", 0}, {"INACTIVE", 0}}}, + {"TOOL_ASSET_ID", {}}, + {"TOOL_GROUP", {}}, + {"TOOL_ID", {}}, + {"TOOL_NUMBER", {}}, + {"TOOL_OFFSET", {}}, + {"USER", {}}, + {"VARIABLE", {}}, + {"WAIT_STATE", {{"POWERING_UP", 0}, {"POWERING_DOWN", 0}, {"PART_LOAD", 0}, {"PART_UNLOAD", 0}, {"TOOL_LOAD", 0}, {"TOOL_UNLOAD", 0}, {"MATERIAL_LOAD", 0}, {"MATERIAL_UNLOAD", 0}, {"SECONDARY_PROCESS", 0}, {"PAUSING", 0}, {"RESUMING", 0}}}, + {"WIRE", {}}, + {"WORKHOLDING_ID", {}}, + {"WORK_OFFSET", {}}, + {"OPERATING_SYSTEM", {}}, + {"FIRMWARE", {}}, + {"APPLICATION", {}}, + {"LIBRARY", {}}, + {"HARDWARE", {}}, + {"NETWORK", {}}, + {"ROTATION", {}}, + {"TRANSLATION", {}}, + {"PROCESS_KIND_ID", {}}, + {"PART_STATUS", {{"PASS", 0}, {"FAIL", 0}}}, + {"ALARM_LIMIT", {}}, + {"PROCESS_AGGREGATE_ID", {}}, + {"PART_KIND_ID", {}}, + {"ADAPTER_URI", {}}, + {"DEVICE_REMOVED", {}}, + {"DEVICE_CHANGED", {}}, + {"SPECIFICATION_LIMIT", {}}, + {"CONNECTION_STATUS", {{"CLOSED", 0}, {"LISTEN", 0}, {"ESTABLISHED", 0}}}, + {"ADAPTER_SOFTWARE_VERSION", {}}, + {"SENSOR_ATTACHMENT", {}}, + {"CONTROL_LIMIT", {}}, + {"DEVICE_ADDED", {}}, + {"MTCONNECT_VERSION", {}}, + {"PROCESS_OCCURRENCE_ID", {}}, + {"PART_GROUP_ID", {}}, + {"PART_UNIQUE_ID", {}}, + {"ACTIVATION_COUNT", {}}, + {"DEACTIVATION_COUNT", {}}, + {"TRANSFER_COUNT", {}}, + {"LOAD_COUNT", {}}, + {"PART_PROCESSING_STATE", {{"NEEDS_PROCESSING", 0}, {"IN_PROCESS", 0}, {"PROCESSING_ENDED", 0}, {"PROCESSING_ENDED_COMPLETE", 0}, {"PROCESSING_ENDED_STOPPED", 0}, {"PROCESSING_ENDED_ABORTED", 0}, {"PROCESSING_ENDED_LOST", 0}, {"PROCESSING_ENDED_SKIPPED", 0}, {"PROCESSING_ENDED_REJECTED", 0}, {"WAITING_FOR_TRANSIT", 0}, {"IN_TRANSIT", 0}, {"TRANSIT_COMPLETE", 0}}}, + {"PROCESS_STATE", {{"INITIALIZING", 0}, {"READY", 0}, {"ACTIVE", 0}, {"COMPLETE", 0}, {"INTERRUPTED", 0}, {"ABORTED", 0}}}, + {"VALVE_STATE", {{"OPEN", 0}, {"OPENING", 0}, {"CLOSED", 0}, {"CLOSING", 0}}}, + {"LOCK_STATE", {{"LOCKED", 0}, {"UNLOCKED", 0}}}, + {"UNLOAD_COUNT", {}}, + {"CYCLE_COUNT", {}}, + {"OPERATING_MODE", {{"AUTOMATIC", 0}, {"MANUAL", 0}, {"SEMI_AUTOMATIC", 0}}}, + {"ASSET_COUNT", {}}, + {"MAINTENANCE_LIST", {}}, + {"FIXTURE_ID", {}}, + {"PART_COUNT_TYPE", {{"EACH", 0}, {"BATCH", 0}}}, + {"CLOCK_TIME", {}}, + {"NETWORK_PORT", {}}, + {"HOST_NAME", {}}, + {"LEAK_DETECT", {{"DETECTED", 0}, {"NOT_DETECTED", 0}}}, + {"BATTERY_STATE", {{"CHARGED", 0}, {"CHARGING", 0}, {"DISCHARGING", 0}, {"DISCHARGED", 0}}}, + {"FEATURE_PERSISTENT_ID", {}}, + {"SENSOR_STATE", {}}, + {"COMPONENT_DATA", {}}, + {"WORK_OFFSETS", {}}, + {"TOOL_OFFSETS", {}}, + {"FEATURE_MEASUREMENT", {}}, + {"ADAPTER_URI", {}}, + {"MEASUREMENT_TYPE", {}}, + {"MEASUREMENT_VALUE", {}}, + {"MEASUREMENT_UNITS", {}}, + {"ADAPTER_URI", {{"PASS", 0}, {"FAIL", 0}, {"REWORK", 0}, {"SYSTEM_ERROR", 0}, {"INDETERMINATE", 0}, {"NOT_ANALYZED", 0}, {"BASIC_OR_THEORETIC_EXACT_DIMENSION", 0}, {"UNDEFINED", 0}}}, + {"UNCERTAINTY_TYPE", {{"COMBINED", 0}, {"MEAN", 0}}}, + {"UNCERTAINTY", {}}, + {"ALARM_LIMIT", {}}, + {"CONTROL_LIMIT", {}}, + {"SPECIFICATION_LIMIT", {}}, + {"TOOL_CUTTING_ITEM", {}}, + {"LOCATION_ADDRESS", {}}, + {"ACTIVE_POWER_SOURCE", {}}, + {"LOCATION_NARRATIVE", {}}, + {"THICKNESS", {}}, + {"LOCATION_SPATIAL_GEOGRAPHIC", {}} + }; diff --git a/src/mtconnect/validation/observations.cpp b/src/mtconnect/validation/observations.cpp new file mode 100644 index 00000000..4f2825a5 --- /dev/null +++ b/src/mtconnect/validation/observations.cpp @@ -0,0 +1,22 @@ +// +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#include "observations.hpp" + +namespace mtconnect::validation::observations { +#include "observation_validations.hpp" +} diff --git a/src/mtconnect/validation/observations.hpp b/src/mtconnect/validation/observations.hpp new file mode 100644 index 00000000..a9d8c005 --- /dev/null +++ b/src/mtconnect/validation/observations.hpp @@ -0,0 +1,29 @@ +// +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +#pragma once + +#include "../utilities.hpp" + +#include +#include + +namespace mtconnect::validation::observations { + using Validation = std::unordered_map>; + + const extern Validation ControlledVocabularies; +} diff --git a/src/mtconnect/version.cpp b/src/mtconnect/version.cpp index b27f769f..8a082fb3 100644 --- a/src/mtconnect/version.cpp +++ b/src/mtconnect/version.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/CMakeLists.txt b/test_package/CMakeLists.txt index 927946eb..08a4e1ff 100644 --- a/test_package/CMakeLists.txt +++ b/test_package/CMakeLists.txt @@ -277,6 +277,7 @@ add_agent_test(pipeline_edit FALSE pipeline) add_agent_test(mtconnect_xml_transform FALSE pipeline) add_agent_test(response_document FALSE pipeline) add_agent_test(json_mapping FALSE pipeline) +add_agent_test(observation_validation TRUE pipeline) add_agent_test(agent TRUE core) add_agent_test(globals FALSE core) diff --git a/test_package/adapter_test.cpp b/test_package/adapter_test.cpp index 8fa5eba8..58712ec9 100644 --- a/test_package/adapter_test.cpp +++ b/test_package/adapter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_adapter_test.cpp b/test_package/agent_adapter_test.cpp index 2942befa..807e366e 100644 --- a/test_package/agent_adapter_test.cpp +++ b/test_package/agent_adapter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_device_test.cpp b/test_package/agent_device_test.cpp index 02a131df..da174ed8 100644 --- a/test_package/agent_device_test.cpp +++ b/test_package/agent_device_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_test.cpp b/test_package/agent_test.cpp index b4d44155..d7b673f8 100644 --- a/test_package/agent_test.cpp +++ b/test_package/agent_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_test_helper.cpp b/test_package/agent_test_helper.cpp index 8cc85fba..c1dd2ccb 100644 --- a/test_package/agent_test_helper.cpp +++ b/test_package/agent_test_helper.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/agent_test_helper.hpp b/test_package/agent_test_helper.hpp index 39c85788..13c14fc9 100644 --- a/test_package/agent_test_helper.hpp +++ b/test_package/agent_test_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/asset_buffer_test.cpp b/test_package/asset_buffer_test.cpp index 54d5c407..92efefea 100644 --- a/test_package/asset_buffer_test.cpp +++ b/test_package/asset_buffer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/asset_hash_test.cpp b/test_package/asset_hash_test.cpp index 6d5529e4..ae17a166 100644 --- a/test_package/asset_hash_test.cpp +++ b/test_package/asset_hash_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/asset_test.cpp b/test_package/asset_test.cpp index 49e383f3..f5fd9282 100644 --- a/test_package/asset_test.cpp +++ b/test_package/asset_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/change_observer_test.cpp b/test_package/change_observer_test.cpp index e3f90663..b7501a6c 100644 --- a/test_package/change_observer_test.cpp +++ b/test_package/change_observer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/checkpoint_test.cpp b/test_package/checkpoint_test.cpp index e810b8d3..f874ae5c 100644 --- a/test_package/checkpoint_test.cpp +++ b/test_package/checkpoint_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/circular_buffer_test.cpp b/test_package/circular_buffer_test.cpp index ca19a6ea..4e935c94 100644 --- a/test_package/circular_buffer_test.cpp +++ b/test_package/circular_buffer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/component_parameters_test.cpp b/test_package/component_parameters_test.cpp index 6df0c76d..076175db 100644 --- a/test_package/component_parameters_test.cpp +++ b/test_package/component_parameters_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/component_test.cpp b/test_package/component_test.cpp index 53c8c583..b4b8c1a8 100644 --- a/test_package/component_test.cpp +++ b/test_package/component_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/composition_test.cpp b/test_package/composition_test.cpp index b9e75879..4501ac3f 100644 --- a/test_package/composition_test.cpp +++ b/test_package/composition_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/config_parser_test.cpp b/test_package/config_parser_test.cpp index 2bc8f987..fab7e9ad 100644 --- a/test_package/config_parser_test.cpp +++ b/test_package/config_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/config_test.cpp b/test_package/config_test.cpp index 296931c9..b4cf02da 100644 --- a/test_package/config_test.cpp +++ b/test_package/config_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/connector_test.cpp b/test_package/connector_test.cpp index 48017903..e40c351d 100644 --- a/test_package/connector_test.cpp +++ b/test_package/connector_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/coordinate_system_test.cpp b/test_package/coordinate_system_test.cpp index 3b9c380a..4a4f5653 100644 --- a/test_package/coordinate_system_test.cpp +++ b/test_package/coordinate_system_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/cutting_tool_test.cpp b/test_package/cutting_tool_test.cpp index 5f1c04ef..4647cc03 100644 --- a/test_package/cutting_tool_test.cpp +++ b/test_package/cutting_tool_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/data_item_mapping_test.cpp b/test_package/data_item_mapping_test.cpp index 4a6c983d..f36ed739 100644 --- a/test_package/data_item_mapping_test.cpp +++ b/test_package/data_item_mapping_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/data_item_test.cpp b/test_package/data_item_test.cpp index 178bb1ca..5e88dc6f 100644 --- a/test_package/data_item_test.cpp +++ b/test_package/data_item_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/data_set_test.cpp b/test_package/data_set_test.cpp index 4c2fd43c..24566788 100644 --- a/test_package/data_set_test.cpp +++ b/test_package/data_set_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/device_test.cpp b/test_package/device_test.cpp index a0a72892..6bb14a65 100644 --- a/test_package/device_test.cpp +++ b/test_package/device_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/duplicate_filter_test.cpp b/test_package/duplicate_filter_test.cpp index a9b1de3f..459c50de 100644 --- a/test_package/duplicate_filter_test.cpp +++ b/test_package/duplicate_filter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/embedded_ruby_test.cpp b/test_package/embedded_ruby_test.cpp index b12e36b5..c60dc141 100644 --- a/test_package/embedded_ruby_test.cpp +++ b/test_package/embedded_ruby_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/entity_parser_test.cpp b/test_package/entity_parser_test.cpp index c34a8485..ab752021 100644 --- a/test_package/entity_parser_test.cpp +++ b/test_package/entity_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/entity_printer_test.cpp b/test_package/entity_printer_test.cpp index 22dd514b..2999fe1e 100644 --- a/test_package/entity_printer_test.cpp +++ b/test_package/entity_printer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/entity_test.cpp b/test_package/entity_test.cpp index f10318fd..88396d8d 100644 --- a/test_package/entity_test.cpp +++ b/test_package/entity_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/file_asset_test.cpp b/test_package/file_asset_test.cpp index a2d57c93..9b5a753e 100644 --- a/test_package/file_asset_test.cpp +++ b/test_package/file_asset_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/file_cache_test.cpp b/test_package/file_cache_test.cpp index 6d453f78..5e916fd2 100644 --- a/test_package/file_cache_test.cpp +++ b/test_package/file_cache_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/globals_test.cpp b/test_package/globals_test.cpp index 23c42339..48cdee99 100644 --- a/test_package/globals_test.cpp +++ b/test_package/globals_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/http_server_test.cpp b/test_package/http_server_test.cpp index 07d69fb6..da52c633 100644 --- a/test_package/http_server_test.cpp +++ b/test_package/http_server_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/image_file_test.cpp b/test_package/image_file_test.cpp index eca9fa5e..9a1ebfe6 100644 --- a/test_package/image_file_test.cpp +++ b/test_package/image_file_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_helper.hpp b/test_package/json_helper.hpp index e23afcb7..5ec63614 100644 --- a/test_package/json_helper.hpp +++ b/test_package/json_helper.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_mapping_test.cpp b/test_package/json_mapping_test.cpp index 6a33d2d0..25267594 100644 --- a/test_package/json_mapping_test.cpp +++ b/test_package/json_mapping_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_parser_test.cpp b/test_package/json_parser_test.cpp index 3995e78a..5db25737 100644 --- a/test_package/json_parser_test.cpp +++ b/test_package/json_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_printer_asset_test.cpp b/test_package/json_printer_asset_test.cpp index 7f478b08..d2e61b8f 100644 --- a/test_package/json_printer_asset_test.cpp +++ b/test_package/json_printer_asset_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_printer_error_test.cpp b/test_package/json_printer_error_test.cpp index 147ce796..f4a2a729 100644 --- a/test_package/json_printer_error_test.cpp +++ b/test_package/json_printer_error_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_printer_probe_test.cpp b/test_package/json_printer_probe_test.cpp index 36b6e711..b5544bc5 100644 --- a/test_package/json_printer_probe_test.cpp +++ b/test_package/json_printer_probe_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_printer_stream_test.cpp b/test_package/json_printer_stream_test.cpp index b00ed3b7..03b1fd8e 100644 --- a/test_package/json_printer_stream_test.cpp +++ b/test_package/json_printer_stream_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/json_printer_test.cpp b/test_package/json_printer_test.cpp index 686ce425..1fbb276f 100644 --- a/test_package/json_printer_test.cpp +++ b/test_package/json_printer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/kinematics_test.cpp b/test_package/kinematics_test.cpp index 1dd927cb..a2bf20d3 100644 --- a/test_package/kinematics_test.cpp +++ b/test_package/kinematics_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/mqtt_adapter_test.cpp b/test_package/mqtt_adapter_test.cpp index 9a14699b..2e2c4683 100644 --- a/test_package/mqtt_adapter_test.cpp +++ b/test_package/mqtt_adapter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/mqtt_isolated_test.cpp b/test_package/mqtt_isolated_test.cpp index 5b7ae824..9789436c 100644 --- a/test_package/mqtt_isolated_test.cpp +++ b/test_package/mqtt_isolated_test.cpp @@ -1,5 +1,5 @@ -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/mqtt_sink_2_test.cpp b/test_package/mqtt_sink_2_test.cpp index 111748a7..bdae5342 100644 --- a/test_package/mqtt_sink_2_test.cpp +++ b/test_package/mqtt_sink_2_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/mqtt_sink_test.cpp b/test_package/mqtt_sink_test.cpp index 85817679..6675811f 100644 --- a/test_package/mqtt_sink_test.cpp +++ b/test_package/mqtt_sink_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/mtconnect_xml_transform_test.cpp b/test_package/mtconnect_xml_transform_test.cpp index cb2b345e..be3e5e6d 100644 --- a/test_package/mtconnect_xml_transform_test.cpp +++ b/test_package/mtconnect_xml_transform_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/observation_test.cpp b/test_package/observation_test.cpp index feb6a10d..3040dfe3 100644 --- a/test_package/observation_test.cpp +++ b/test_package/observation_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/observation_validation_test.cpp b/test_package/observation_validation_test.cpp new file mode 100644 index 00000000..be6699ab --- /dev/null +++ b/test_package/observation_validation_test.cpp @@ -0,0 +1,143 @@ +// +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) +// All rights reserved. +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. +// + +// Ensure that gtest is the first header otherwise Windows raises an error +#include +// Keep this comment to keep gtest.h above. (clang-format off/on is not working here!) + +#include + +#include "mtconnect/entity/entity.hpp" +#include "mtconnect/observation/observation.hpp" +#include "mtconnect/pipeline/validator.hpp" +#include "mtconnect/asset/asset.hpp" +#include "mtconnect/device_model/data_item/data_item.hpp" + +using namespace mtconnect; +using namespace mtconnect::pipeline; +using namespace mtconnect::observation; +using namespace mtconnect::asset; +using namespace mtconnect::device_model::data_item; +using namespace std; +using namespace date::literals; +using namespace std::literals; + +// main +int main(int argc, char *argv[]) +{ + ::testing::InitGoogleTest(&argc, argv); + return RUN_ALL_TESTS(); +} + +class MockPipelineContract : public PipelineContract +{ +public: + MockPipelineContract(std::map &items, int32_t schemaVersion) + : m_dataItems(items), m_schemaVersion(schemaVersion) + {} + DevicePtr findDevice(const std::string &) override { return nullptr; } + DataItemPtr findDataItem(const std::string &device, const std::string &name) override + { + return m_dataItems[name]; + } + void eachDataItem(EachDataItem fun) override {} + void deliverObservation(observation::ObservationPtr obs) override {} + void deliverAsset(AssetPtr) override {} + void deliverDevices(std::list) override {} + int32_t getSchemaVersion() const override { return m_schemaVersion; } + void deliverAssetCommand(entity::EntityPtr) override {} + void deliverCommand(entity::EntityPtr) override {} + void deliverConnectStatus(entity::EntityPtr, const StringList &, bool) override {} + void sourceFailed(const std::string &id) override {} + const ObservationPtr checkDuplicate(const ObservationPtr &obs) const override { return obs; } + + std::map &m_dataItems; + int32_t m_schemaVersion; +}; + +class ObservationValidationTest : public testing::Test +{ +protected: + void SetUp() override + { + m_context = make_shared(); + m_validator = make_shared(m_context); + m_validator->bind(make_shared(TypeGuard(RUN))); + m_time = Timestamp(date::sys_days(2021_y / jan / 19_d)) + 10h + 1min; + + ErrorList errors; + m_dataItem = DataItem::make( + {{"id", "exec"s}, {"category", "EVENT"s}, {"type", "EXECUTION"s}}, + errors); + } + + void TearDown() override + { + m_validator.reset(); + m_dataItem.reset(); + m_context.reset(); + } + + shared_ptr m_validator; + shared_ptr m_context; + DataItemPtr m_dataItem; + Timestamp m_time; +}; + +TEST_F(ObservationValidationTest, should_validate_value) +{ + ErrorList errors; + auto event = Observation::make(m_dataItem, {{"VALUE", "READY"s}}, m_time, errors); + + auto evt = (*m_validator)(std::move(event)); + auto quality = evt->get("quality"); + ASSERT_EQ("VALID", quality); +} + +TEST_F(ObservationValidationTest, unavailable_should_be_valid) +{ + ErrorList errors; + auto event = Observation::make(m_dataItem, {{"VALUE", "UNAVAILABLE"s}}, m_time, errors); + auto evt = (*m_validator)(std::move(event)); + auto quality = evt->get("quality"); + ASSERT_EQ("VALID", quality); +} + +TEST_F(ObservationValidationTest, should_detect_invalid_value) +{ + ErrorList errors; + auto event = Observation::make(m_dataItem, {{"VALUE", "FLABOR"s}}, m_time, errors); + + auto evt = (*m_validator)(std::move(event)); + auto quality = evt->get("quality"); + ASSERT_EQ("INVALID", quality); +} + +TEST_F(ObservationValidationTest, should_not_validate_unknown_type) +{ + ErrorList errors; + m_dataItem = DataItem::make( + {{"id", "exec"s}, {"category", "EVENT"s}, {"type", "x:FLABOR"s}}, + errors); + + auto event = Observation::make(m_dataItem, {{"VALUE", "FLABOR"s}}, m_time, errors); + + auto evt = (*m_validator)(std::move(event)); + auto quality = evt->get("quality"); + ASSERT_EQ("UNVERIFIABLE", quality); +} + diff --git a/test_package/period_filter_test.cpp b/test_package/period_filter_test.cpp index 839792ce..d38cd4d1 100644 --- a/test_package/period_filter_test.cpp +++ b/test_package/period_filter_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/pipeline_deliver_test.cpp b/test_package/pipeline_deliver_test.cpp index 4d611663..3e632ee3 100644 --- a/test_package/pipeline_deliver_test.cpp +++ b/test_package/pipeline_deliver_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/pipeline_edit_test.cpp b/test_package/pipeline_edit_test.cpp index 130c0976..c5b68d90 100644 --- a/test_package/pipeline_edit_test.cpp +++ b/test_package/pipeline_edit_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/qif_document_test.cpp b/test_package/qif_document_test.cpp index 269353f9..68097689 100644 --- a/test_package/qif_document_test.cpp +++ b/test_package/qif_document_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/qname_test.cpp b/test_package/qname_test.cpp index 9462d1e0..05ac55b3 100644 --- a/test_package/qname_test.cpp +++ b/test_package/qname_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/raw_material_test.cpp b/test_package/raw_material_test.cpp index 558dd262..e7edecf6 100644 --- a/test_package/raw_material_test.cpp +++ b/test_package/raw_material_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/references_test.cpp b/test_package/references_test.cpp index e81aba95..7d18c114 100644 --- a/test_package/references_test.cpp +++ b/test_package/references_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/relationship_test.cpp b/test_package/relationship_test.cpp index c4feb60a..b9ebf7f0 100644 --- a/test_package/relationship_test.cpp +++ b/test_package/relationship_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/response_document_test.cpp b/test_package/response_document_test.cpp index 0ae7316b..50a513ba 100644 --- a/test_package/response_document_test.cpp +++ b/test_package/response_document_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/routing_test.cpp b/test_package/routing_test.cpp index b26a8657..d4457f58 100644 --- a/test_package/routing_test.cpp +++ b/test_package/routing_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/sensor_configuration_test.cpp b/test_package/sensor_configuration_test.cpp index 1d94d46a..eaf783b6 100644 --- a/test_package/sensor_configuration_test.cpp +++ b/test_package/sensor_configuration_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/shdr_tokenizer_test.cpp b/test_package/shdr_tokenizer_test.cpp index 8150df87..76b754d4 100644 --- a/test_package/shdr_tokenizer_test.cpp +++ b/test_package/shdr_tokenizer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/solid_model_test.cpp b/test_package/solid_model_test.cpp index 169eea1e..7cd6696a 100644 --- a/test_package/solid_model_test.cpp +++ b/test_package/solid_model_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/specification_test.cpp b/test_package/specification_test.cpp index dff29781..3e3529fd 100644 --- a/test_package/specification_test.cpp +++ b/test_package/specification_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/table_test.cpp b/test_package/table_test.cpp index 8da67faa..215c8735 100644 --- a/test_package/table_test.cpp +++ b/test_package/table_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/test_utilities.hpp b/test_package/test_utilities.hpp index 7fe6fea0..df1b0699 100644 --- a/test_package/test_utilities.hpp +++ b/test_package/test_utilities.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/testadapter_service.cpp b/test_package/testadapter_service.cpp index 79f08bf7..23ae60b8 100644 --- a/test_package/testadapter_service.cpp +++ b/test_package/testadapter_service.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/testadapter_service.hpp b/test_package/testadapter_service.hpp index 29ec1c06..34732403 100644 --- a/test_package/testadapter_service.hpp +++ b/test_package/testadapter_service.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/testsink_service.cpp b/test_package/testsink_service.cpp index 144ede52..245c9f59 100644 --- a/test_package/testsink_service.cpp +++ b/test_package/testsink_service.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/testsink_service.hpp b/test_package/testsink_service.hpp index affd7c3f..87b6d551 100644 --- a/test_package/testsink_service.hpp +++ b/test_package/testsink_service.hpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/timestamp_extractor_test.cpp b/test_package/timestamp_extractor_test.cpp index 49f05525..dd355f17 100644 --- a/test_package/timestamp_extractor_test.cpp +++ b/test_package/timestamp_extractor_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/tls_http_server_test.cpp b/test_package/tls_http_server_test.cpp index e141502a..830d85f0 100644 --- a/test_package/tls_http_server_test.cpp +++ b/test_package/tls_http_server_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/topic_mapping_test.cpp b/test_package/topic_mapping_test.cpp index 71a53f0b..5d92b44b 100644 --- a/test_package/topic_mapping_test.cpp +++ b/test_package/topic_mapping_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/unit_conversion_test.cpp b/test_package/unit_conversion_test.cpp index e52ee6e9..2998ae54 100644 --- a/test_package/unit_conversion_test.cpp +++ b/test_package/unit_conversion_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/url_parser_test.cpp b/test_package/url_parser_test.cpp index 51afc286..e2b31c5b 100644 --- a/test_package/url_parser_test.cpp +++ b/test_package/url_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/xml_parser_test.cpp b/test_package/xml_parser_test.cpp index 85814ea5..f2c532b9 100644 --- a/test_package/xml_parser_test.cpp +++ b/test_package/xml_parser_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_package/xml_printer_test.cpp b/test_package/xml_printer_test.cpp index 354bfd23..feba4c78 100644 --- a/test_package/xml_printer_test.cpp +++ b/test_package/xml_printer_test.cpp @@ -1,5 +1,5 @@ // -// Copyright Copyright 2009-2022, AMT – The Association For Manufacturing Technology (“AMT”) +// Copyright Copyright 2009-2024, AMT – The Association For Manufacturing Technology (“AMT”) // All rights reserved. // // Licensed under the Apache License, Version 2.0 (the "License");