enhance simulation
This commit is contained in:
22
swissmx.py
22
swissmx.py
@@ -15,9 +15,10 @@ bitmask for simulation:
|
||||
0x02: illumination
|
||||
0x04: zoom
|
||||
0x08: camera
|
||||
0x10: Deltatau motors
|
||||
0x10: Deltatau motors and motion code
|
||||
0x20: SmarAct motors
|
||||
0x40: shutter
|
||||
0x80: Jungfrau
|
||||
|
||||
"""
|
||||
import logging
|
||||
@@ -1979,7 +1980,7 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
app=QApplication.instance()
|
||||
if calib:
|
||||
_log.info("received new pix2pos calibration")
|
||||
QMessageBox.information(self,'Pixel to position calibration','''\
|
||||
QMessageBox.information(self,'Pixel to position calibration','''\
|
||||
- for each zoom level:
|
||||
- choose a good fiducial mark
|
||||
- move the stage x/y at min. 3 different locations
|
||||
@@ -2217,11 +2218,11 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
try:
|
||||
dt=app._deltatau
|
||||
except AttributeError:
|
||||
app._deltatau=dt=psi_device.Deltatau()
|
||||
app._deltatau=dt=psi_device.Deltatau(app._args.sim&0x10!=0)
|
||||
try:
|
||||
jf=app._jungfrau
|
||||
except AttributeError:
|
||||
app._jungfrau=jf=psi_device.Jungfrau()
|
||||
app._jungfrau=jf=psi_device.Jungfrau(app._args.sim&0x80!=0)
|
||||
sp=dt._shapepath
|
||||
sp.verbose=dt_misc['verbose']
|
||||
|
||||
@@ -2285,10 +2286,11 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
|
||||
sp.setup_coord_trf(fx, fy, cz) # reset to shape path system
|
||||
|
||||
try:
|
||||
sp.comm.gpascii._cb_func=lambda i, sz:self.cb_progress(i, sz, dlg)
|
||||
except AttributeError:
|
||||
pass
|
||||
comm=sp.comm
|
||||
if comm is None:
|
||||
_log.info('simulated')
|
||||
else:
|
||||
comm.gpascii._cb_func=lambda i, sz:self.cb_progress(i, sz, dlg)
|
||||
|
||||
if dlg.wasCanceled():
|
||||
return
|
||||
@@ -2300,9 +2302,9 @@ Author Thierry Zamofing (thierry.zamofing@psi.ch)
|
||||
jf.acquire(num_pts)
|
||||
sp.trigger(0.5) # send a start trigger (if needed) after given time
|
||||
if dt._comm is None:
|
||||
dlg.setLabelText("run motion/acquisition")
|
||||
dlg.setLabelText("run motion/acquisition (simulated)")
|
||||
dlg.setMaximum(num_pts)
|
||||
for p in range(0,num_pts,int(num_pts/1000)):
|
||||
for p in range(0,num_pts,int(num_pts/100)):
|
||||
#_log.info(f'progress {p}/{num_pts}')
|
||||
dlg.setValue(p)
|
||||
time.sleep(.1)
|
||||
|
||||
Reference in New Issue
Block a user