File tree Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Expand file tree Collapse file tree 4 files changed +16
-3
lines changed Original file line number Diff line number Diff line change 22set (AGENT_VERSION_MAJOR 2)
33set (AGENT_VERSION_MINOR 3)
44set (AGENT_VERSION_PATCH 0)
5- set (AGENT_VERSION_BUILD 13 )
5+ set (AGENT_VERSION_BUILD 14 )
66set (AGENT_VERSION_RC "" )
77
88# This minimum version is to support Visual Studio 2019 and C++ feature checking and FetchContent
Original file line number Diff line number Diff line change 2929# ---------------------------------------------------------------------
3030
3131# base image - alpine 3.18
32- FROM alpine:3.18 AS os
32+ FROM alpine:3.19 AS os
3333
3434# ---------------------------------------------------------------------
3535# build
@@ -63,7 +63,9 @@ RUN apk --update add \
6363 python3 \
6464 ruby \
6565 ruby-rake \
66- && PIP_ROOT_USER_ACTION='ignore' pip install conan
66+ && python3 -m venv /python/conan \
67+ && . /python/conan/bin/activate \
68+ && PIP_ROOT_USER_ACTION='ignore' pip install conan
6769
6870# make an agent directory and cd into it
6971WORKDIR /root/agent
@@ -80,6 +82,7 @@ RUN if [ -z "$WITH_TESTS" ] || [ "$WITH_TESTS" = "false" ]; then \
8082 else \
8183 WITH_TESTS_ARG="" ; \
8284 fi \
85+ && . /python/conan/bin/activate \
8386 && conan profile detect \
8487 && conan create cppagent \
8588 --build=missing \
Original file line number Diff line number Diff line change @@ -137,6 +137,8 @@ namespace mtconnect::pipeline {
137137 }
138138 else
139139 {
140+ if (m_source)
141+ dataItem->setDataSource (*m_source);
140142 m_entities.push_back (obs);
141143 m_forward (std::move (obs));
142144 }
@@ -169,6 +171,7 @@ namespace mtconnect::pipeline {
169171 DevicePtr m_defaultDevice;
170172 optional<Timestamp> m_timestamp;
171173 optional<double > m_duration;
174+ optional<string> m_source;
172175
173176 EntityList m_entities;
174177 PipelineContextPtr m_pipelineContext;
@@ -1014,6 +1017,7 @@ namespace mtconnect::pipeline {
10141017 {
10151018 static const auto GetParseError = rj::GetParseError_En;
10161019
1020+ auto source = entity->maybeGet <string>(" source" );
10171021 auto json = std::dynamic_pointer_cast<JsonMessage>(entity);
10181022 DevicePtr device = json->m_device .lock ();
10191023 auto &body = entity->getValue <std::string>();
@@ -1023,6 +1027,7 @@ namespace mtconnect::pipeline {
10231027 reader.IterativeParseInit ();
10241028 ParserContext context (m_context);
10251029 context.m_forward = [this ](entity::EntityPtr &&entity) { next (std::move (entity)); };
1030+ context.m_source = source;
10261031
10271032 TopLevelHandler handler (context);
10281033 if (device)
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ namespace mtconnect::pipeline {
4646
4747 EntityPtr operator ()(entity::EntityPtr &&entity) override
4848 {
49+ auto source = entity->maybeGet <string>(" source" );
4950 auto data = std::dynamic_pointer_cast<DataMessage>(entity);
5051 if (data->m_dataItem )
5152 {
@@ -56,7 +57,11 @@ namespace mtconnect::pipeline {
5657 auto obs = observation::Observation::make (data->m_dataItem , props,
5758 std::chrono::system_clock::now (), errors);
5859 if (errors.empty ())
60+ {
61+ if (source)
62+ data->m_dataItem ->setDataSource (*source);
5963 return next (std::move (obs));
64+ }
6065 }
6166 catch (entity::EntityError &e)
6267 {
You can’t perform that action at this time.
0 commit comments