From 94456073b43ee3613dbd9f25b8120c15608b9e9d Mon Sep 17 00:00:00 2001 From: "Christian Tremblay, ing" Date: Sun, 18 Oct 2020 14:03:37 -0400 Subject: [PATCH] Brought back the size argument to update_history_size function. Name the device history_size 'default_history_size' becuase this is what it is and technically, it's possible to define different history size for different points. --- BAC0/core/devices/Device.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/BAC0/core/devices/Device.py b/BAC0/core/devices/Device.py index 0982f1c1..6fd2750d 100755 --- a/BAC0/core/devices/Device.py +++ b/BAC0/core/devices/Device.py @@ -150,7 +150,7 @@ def __init__( self.properties.multistates = {} self.properties.auto_save = auto_save self.properties.clear_history_on_save = clear_history_on_save - self.properties.history_size = history_size + self.properties.default_history_size = history_size self.segmentation_supported = segmentation_supported self.custom_object_list = object_list @@ -315,9 +315,9 @@ def clear_histories(self): for point in self.points: point.clear_history() - def update_history_size(self): + def update_history_size(self, size=None): for point in self.points: - point.properties.history_size = self.properties.history_size + point.properties.history_size = size @property def analog_units(self): @@ -529,9 +529,8 @@ def _buildPointList(self): ) if self.properties.pollDelay > 0: self.poll(delay=self.properties.pollDelay) - if self.properties.history_size is not None: - self.update_history_size() - self.clear_histories() + self.update_history_size(size=self.properties.default_history_size) + #self.clear_histories() except NoResponseFromController as error: self._log.error("Cannot retrieve object list, disconnecting...") self.segmentation_supported = False