try to cleanup stuff(2)

This commit is contained in:
2024-11-27 11:30:06 +01:00
parent 24b7f1292d
commit cc7d7c8e79
2 changed files with 63 additions and 37 deletions

View File

@@ -2139,41 +2139,7 @@ object settings:
bm_pos=self._goBeamMarker.pos()
bm_sz=self._goBeamMarker.size()
idx=mft._cbType.currentIndex()
param=mft._txtParam.text().replace('(','[').replace(')',']').strip()
if param=='' or param[0]!='{':
param='{'+param+'}'
#mft._cbType.addItems(["Fiducial", "FixTarget(12.5x12.5)", "FixTarget(23.0x23.0)", "FixTarget(<param>)", "Grid(<param>)", "SwissMX-path"])
#bm_pos_eu=self._goBeamMarker._pos_eu
#bm_size_eu=self._goBeamMarker._size_eu
try:
#parse the parameters: 'key:value [,key:value]'
# as key value separator : and = are allowed
#examples:
#Fiducial:
# no param
#FixTarget(12.5x12.5), FixTarget(23.0x23.0), FixTarget(test):
# code_gen:2
# code_gen=3 | tmove=10 | twait=30
#Grid():
# size:(30, 20)
# cnt:(30, 22)
# fiducialSize:0.1
#SwissMX():
# ofs:(.2, .2)
# width:10
# fidScl:.02
# fiducial:((.1, .1), (.1, 2.7), (10.3, .1), (10.3, 2.7))
#SwissFEL():
# ofs:(.2, .2)
# width:10
# fidScl:.02
# fiducial:((.1, .1), (.1, 2.2), (10.3, .1), (10.3, 2.2))
param=param.replace(':', ': ') # allow gen:4 without space
param=yaml.safe_load(param) # "ofs":[10, 5],"width":200,"fidScl":0.5,"fiducial":[[18,7],[25,16],[70, 20]]
except BaseException as e:
_log.error(f'{e}:{param}')
param=dict()
param=mft.get_param()
if idx==0:
#go=UsrGO.Fiducial(bm_pos+bm_sz/2-(20, 20), (40, 40),(fx,fy,bz))
l=.120
@@ -2355,7 +2321,10 @@ object settings:
sp.setup_sync(verbose=sp.verbose&0x40, timeOfs=dt_misc['time_ofs'], timeCor=dt_misc['time_cor'])
dlg.setLabelText("Download motion program");dlg+=5
sp.setup_motion(fnPrg=fn+'.prg', **kwargs)
try:
sp.setup_motion(fnPrg=fn+'.prg', **kwargs)
except BaseException as e:
_log.error(repr(e));return
sp.setup_gather()
try:
p=geo._fitPlane