various stuff

update fiducial z when moved
autofocus param
camera settings
This commit is contained in:
2022-09-16 17:04:04 +02:00
parent ba4f5feecb
commit 33ce6c99f3
6 changed files with 104 additions and 14 deletions

View File

@@ -1596,10 +1596,14 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
def cb_autofocus(self):
app=QApplication.instance()
cfg=app._cfg
geo=app._geometry
#geo.autofocus(app._camera, self.tweakers['base_z'],rng=(-1, 1), n=30,saveImg=True)
n=10
rng=(-1, 1)
misc=cfg.value(AppCfg.GBL_MISC)
af_range=misc['af_range']
n=misc['af_steps']
rng=(-af_range/2, af_range/2)
with pg.ProgressDialog('Progress', 0, n) as dlg:
geo.autofocus(app._camera, self.tweakers['base_z'],rng, n,dlg)
@@ -1947,6 +1951,9 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
go.setPos(geo._opt_ctr-oc_sz/2)
go.blockSignals(False) # allow to call cb_marker_moved
def cb_fiducial_update_z(self,obj,*vargs):
obj._z=self.tweakers["base_z"].get_rbv()
def module_fix_target_add_obj(self,*args,**kwargs):
mft=self._moduleFixTarget
fx=self.tweakers["fast_x"].get_rbv()
@@ -1969,6 +1976,7 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
#go=UsrGO.Fiducial(bm_pos+bm_sz/2-(20, 20), (40, 40),(fx,fy,bz))
l=.120
go=UsrGO.Fiducial((fx-l/2,fy-l/2), (l, l),bz)
go.sigRegionChangeFinished.connect(self.cb_fiducial_update_z)
elif idx==1:
v=geo.pos2pix((12.5, 0))
l=np.linalg.norm(v)