Skip to content
Snippets Groups Projects
Commit aa4f229f authored by Giulio Gaio's avatar Giulio Gaio
Browse files

Fixed circular buffer shift direction

parent f595f4b5
No related branches found
Tags 1.0.7
No related merge requests found
...@@ -497,36 +497,36 @@ class DeviceObj: ...@@ -497,36 +497,36 @@ class DeviceObj:
attribute = self.prefix()+'{:03d}_MinMax_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value attribute = self.prefix()+'{:03d}_MinMax_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value
val = np.roll(val, -1);val[-1] = self.minmax; selfseq_dev.write_attribute(attribute,val) val = np.roll(val, -1);val[-1] = self.minmax; selfseq_dev.write_attribute(attribute,val)
if self.tag == SENSOR_TAG: if self.tag == SENSOR_TAG:
for target in target_dev: for target in target_dev:
if target.enable == True: if target.enable == True:
if self.enable_targets & (1 << target.index): if self.enable_targets & (1 << target.index):
attribute='s{:03d}_t{:03d}_Corr'.format(self.index+1,target.index+1) attribute='s{:03d}_t{:03d}_Corr'.format(self.index+1,target.index+1)
selfseq_dev.write_attribute(attribute,self.corr[target.index]); selfseq_dev.write_attribute(attribute,self.corr[target.index]);
attribute='s{:03d}_t{:03d}_CorrFiltAbs'.format(self.index+1,target.index+1) attribute='s{:03d}_t{:03d}_CorrFiltAbs'.format(self.index+1,target.index+1)
selfseq_dev.write_attribute(attribute,self.lp_filter_corr[target.index]); selfseq_dev.write_attribute(attribute,self.lp_filter_corr[target.index]);
attribute='s{:03d}_t{:03d}_CorrHigh'.format(self.index+1,target.index+1) attribute='s{:03d}_t{:03d}_CorrHigh'.format(self.index+1,target.index+1)
selfseq_dev.write_attribute(attribute,self.corr_high[target.index]); selfseq_dev.write_attribute(attribute,self.corr_high[target.index]);
attribute='s{:03d}_t{:03d}_CorrLow'.format(self.index+1,target.index+1) attribute='s{:03d}_t{:03d}_CorrLow'.format(self.index+1,target.index+1)
selfseq_dev.write_attribute(attribute,self.corr_low[target.index]); selfseq_dev.write_attribute(attribute,self.corr_low[target.index]);
attribute='s{:03d}_t{:03d}_Direction'.format(self.index+1,target.index+1) attribute='s{:03d}_t{:03d}_Direction'.format(self.index+1,target.index+1)
selfseq_dev.write_attribute(attribute,self.sensor_direction[target.index]); selfseq_dev.write_attribute(attribute,self.sensor_direction[target.index]);
# History for Corr, CorrFiltAbs, CorrLow, CorrHigh # History for Corr, CorrFiltAbs, CorrLow, CorrHigh
# corr # corr
attribute = self.prefix()+'s{:03d}_t{:03d}_Corr_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value attribute ='s{:03d}_t{:03d}_Corr_History'.format(self.index+1,target.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value
val = np.roll(val, -1);val[-1] = self.corr[target.index]; selfseq_dev.write_attribute(attribute,val) val = np.roll(val, -1);val[-1] = self.corr[target.index]; selfseq_dev.write_attribute(attribute,val)
# corrfiltabs # corrfiltabs
attribute = self.prefix()+'s{:03d}_t{:03d}_CorrFiltAbs_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value attribute = 's{:03d}_t{:03d}_CorrFiltAbs_History'.format(self.index+1,target.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value
val = np.roll(val, -1);val[-1] = self.lp_filter_corr[target.index]; selfseq_dev.write_attribute(attribute,val) val = np.roll(val, -1);val[-1] = self.lp_filter_corr[target.index]; selfseq_dev.write_attribute(attribute,val)
# corrlow # corrlow
attribute = self.prefix()+'s{:03d}_t{:03d}_CorrLow_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value attribute = 's{:03d}_t{:03d}_CorrLow_History'.format(self.index+1,target.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value
val = np.roll(val, -1);val[-1] = self.corr_low[target.index]; selfseq_dev.write_attribute(attribute,val) val = np.roll(val, -1);val[-1] = self.corr_low[target.index]; selfseq_dev.write_attribute(attribute,val)
# corrhigh # corrhigh
attribute = self.prefix()+'s{:03d}_t{:03d}_CorrHigh_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value attribute = 's{:03d}_t{:03d}_CorrHigh_History'.format(self.index+1,target.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value
val = np.roll(val, -1);val[-1] = self.corr_high[target.index]; selfseq_dev.write_attribute(attribute,val) val = np.roll(val, -1);val[-1] = self.corr_high[target.index]; selfseq_dev.write_attribute(attribute,val)
elif self.tag == TARGET_TAG: elif self.tag == TARGET_TAG:
...@@ -546,19 +546,19 @@ class DeviceObj: ...@@ -546,19 +546,19 @@ class DeviceObj:
# History for Corr, CorrFiltAbs, CorrLow, CorrHigh # History for Corr, CorrFiltAbs, CorrLow, CorrHigh
# corr # corr
attribute = self.prefix()+'t{:03d}_t{:03d}_Corr_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value attribute = 't{:03d}_t{:03d}_Corr_History'.format(self.index+1,target.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value
val = np.roll(val, -1);val[-1] = self.corr[target.index]; selfseq_dev.write_attribute(attribute,val) val = np.roll(val, -1);val[-1] = self.corr[target.index]; selfseq_dev.write_attribute(attribute,val)
# corrfiltabs # corrfiltabs
attribute = self.prefix()+'t{:03d}_t{:03d}_CorrFiltAbs_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value attribute = 't{:03d}_t{:03d}_CorrFiltAbs_History'.format(self.index+1,target.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value
val = np.roll(val, -1);val[-1] = self.lp_filter_corr[target.index]; selfseq_dev.write_attribute(attribute,val) val = np.roll(val, -1);val[-1] = self.lp_filter_corr[target.index]; selfseq_dev.write_attribute(attribute,val)
# corrlow # corrlow
attribute = self.prefix()+'t{:03d}_t{:03d}_CorrLow_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value attribute = 't{:03d}_t{:03d}_CorrLow_History'.format(self.index+1,target.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value
val = np.roll(val, -1);val[-1] = self.corr_low[target.index]; selfseq_dev.write_attribute(attribute,val) val = np.roll(val, -1);val[-1] = self.corr_low[target.index]; selfseq_dev.write_attribute(attribute,val)
# corrhigh # corrhigh
attribute = self.prefix()+'t{:03d}_t{:03d}_CorrHigh_History'.format(self.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value attribute = 't{:03d}_t{:03d}_CorrHigh_History'.format(self.index+1,target.index+1); val = selfseq_dev.read_attribute(attribute); val = val.value
val = np.roll(val, -1);val[-1] = self.corr_high[target.index]; selfseq_dev.write_attribute(attribute,val) val = np.roll(val, -1);val[-1] = self.corr_high[target.index]; selfseq_dev.write_attribute(attribute,val)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment