diff --git a/siriuspy/siriuspy/sofb/main.py b/siriuspy/siriuspy/sofb/main.py index 9f2412280..68b7b6699 100644 --- a/siriuspy/siriuspy/sofb/main.py +++ b/siriuspy/siriuspy/sofb/main.py @@ -51,7 +51,7 @@ def __init__( self._max_delta_kick['rf'] = 10 self._meas_respmat_kick['rf'] = 80 if self.acc == 'SI': - self._fofb = HLFOFB() + self.fofb = HLFOFB() self._download_fofb_kicks = False self._update_fofb_reforb = False self._donot_affect_fofb_bpms = False @@ -502,10 +502,11 @@ def _update_status(self): self.run_callbacks('Status-Mon', self._status) # Update PVs related to interaction with FOFB: - download = self._download_fofb_kicks and self._fofb.loop_state - update = self._update_fofb_reforb and self._fofb.loop_state - project = self._project_onto_fofb_nullspace and self._fofb.loop_state - donot = self._donot_affect_fofb_bpms and self._fofb.loop_state + fofb_state = self.fofb.connected and self.fofb.loop_state + download = self._download_fofb_kicks and fofb_state + update = self._update_fofb_reforb and fofb_state + project = self._project_onto_fofb_nullspace and fofb_state + donot = self._donot_affect_fofb_bpms and fofb_state self.run_callbacks('FOFBDownloadKicks-Mon', download) self.run_callbacks('FOFBUpdateRefOrb-Mon', update) self.run_callbacks('FOFBNullSpaceProj-Mon', project) @@ -782,9 +783,11 @@ def _do_auto_corr(self): bpmsfreq = self._csorb.BPMsFreq zer = _np.zeros(self._csorb.nr_corrs, dtype=float) self._pid_errs = [zer, zer.copy(), zer.copy()] - fofb = self._fofb - refx0 = fofb.refx - refy0 = fofb.refy + fofb = self.fofb + refx0 = refy0 = None + if fofb.connected: + refx0 = fofb.refx + refy0 = fofb.refy wait_orb_error = int(5) previous_orb_problem = False @@ -1006,7 +1009,7 @@ def _check_valid_orbit(self, orbit): return True def _interact_with_fofb_in_calc_kicks(self, orb): - fofb = self._fofb + fofb = self.fofb if self._donot_affect_fofb_bpms and fofb.loop_state: enbllist = _np.r_[fofb.bpmxenbl, fofb.bpmyenbl] @@ -1023,11 +1026,11 @@ def _interact_with_fofb_in_calc_kicks(self, orb): def _interact_with_fofb_in_apply_kicks( self, kicks, dkicks, refx=None, refy=None): - fofb = self._fofb + fofb = self.fofb - if refx is None or refy is None: - refx = fofb.refx - refy = fofb.refy + # if refx is None or refy is None: + # refx = fofb.refx + # refy = fofb.refy if self._update_fofb_reforb and fofb.loop_state: dorb = self.matrix.estimate_orbit_variation(dkicks) diff --git a/siriuspy/siriuspy/sofb/orbit.py b/siriuspy/siriuspy/sofb/orbit.py index 5ac931f50..ca1b79584 100644 --- a/siriuspy/siriuspy/sofb/orbit.py +++ b/siriuspy/siriuspy/sofb/orbit.py @@ -701,6 +701,9 @@ def _synchronize_bpms(self): bpm.monit_sync_enbl = _csbpm.EnbldDsbld.disabled bpm.monit1_sync_enbl = _csbpm.EnbldDsbld.disabled + if self.sofb.fofb.connected: + self.sofb.fofb.cmd_sync_net() + def set_trig_acq_control(self, value): """.""" acqctrl = self._csorb.TrigAcqCtrl