Skip to content

Commit

Permalink
Merge pull request #2360 from rlutes/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
craig8 authored Jul 31, 2020
2 parents 3b207fa + 0b349de commit 0308328
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 16 deletions.
26 changes: 18 additions & 8 deletions services/core/ForwardHistorian/forwarder/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,19 +218,29 @@ def _capture_device_data(self, peer, sender, bus, topic, headers, message):
# will be kept.
if _filter in device:
for point in point_list:
# Only points in the point list will be added to the message payload
if point in message[0]:
msg[0][point] = message[0][point]
msg[1][point] = message[1][point]
# devices all publish
if isinstance(message, list):
# Only points in the point list will be added to the message payload
if point in message[0]:
msg[0][point] = message[0][point]
msg[1][point] = message[1][point]
else:
# other devices publish (devices/campus/building/device/point)
msg = None
if point in device:
msg = message
# if the point in in the parsed topic then exit for loop
break
if (isinstance(msg, list) and not msg[0]) or \
(isinstance(msg, (float, int, str)) and msg is None):
_log.debug("Topic: {} - is not in configured to be forwarded".format(topic))
return
else:
msg = message
except Exception as e:
_log.debug("Error handling device_data_filter. {}".format(e))
msg = message
if not msg[0]:
_log.debug("Topic: {} - is not in configured to be forwarded".format(topic))
else:
self.capture_data(peer, sender, bus, topic, headers, msg)
self.capture_data(peer, sender, bus, topic, headers, msg)

def _capture_log_data(self, peer, sender, bus, topic, headers, message):
self.capture_data(peer, sender, bus, topic, headers, message)
Expand Down
26 changes: 18 additions & 8 deletions volttron/platform/agent/base_historian.py
Original file line number Diff line number Diff line change
Expand Up @@ -852,19 +852,29 @@ def _capture_device_data(self, peer, sender, bus, topic, headers,
# will be kept.
if _filter in device:
for point in point_list:
# Only points in the point list will be added to the message payload
if point in message[0]:
msg[0][point] = message[0][point]
msg[1][point] = message[1][point]
# devices all publish
if isinstance(message, list):
# Only points in the point list will be added to the message payload
if point in message[0]:
msg[0][point] = message[0][point]
msg[1][point] = message[1][point]
else:
# other devices publish (devices/campus/building/device/point)
msg = None
if point in device:
msg = message
# if the point in in the parsed topic then exit for loop
break
if (isinstance(msg, list) and not msg[0]) or \
(isinstance(msg, (float, int, str)) and msg is None):
_log.debug("Topic: {} - is not in configured to be stored".format(topic))
return
else:
msg = message
except Exception as e:
_log.debug("Error handling device_data_filter. {}".format(e))
msg = message
if not msg[0]:
_log.debug("Topic: {} - is not in configured to be stored in db".format(topic))
else:
self._capture_data(peer, sender, bus, topic, headers, msg, device)
self._capture_data(peer, sender, bus, topic, headers, msg, device)

def _capture_analysis_data(self, peer, sender, bus, topic, headers,
message):
Expand Down

0 comments on commit 0308328

Please sign in to comment.