wip
This commit is contained in:
@@ -122,8 +122,8 @@ class ARESdevice():
|
||||
'szArm':(20, 50),
|
||||
'aArm':100, # angle RIXS arm
|
||||
'aJFr':140, # angle detector
|
||||
'a2Th':30, # angle 2thetha
|
||||
'aDet':-20, # angle detector
|
||||
'a2Th':116, # angle 2thetha
|
||||
'aDet':100, # angle detector
|
||||
'aTrg':10, # angle target
|
||||
|
||||
'mode':4, #difraction beam paint mode
|
||||
@@ -228,7 +228,7 @@ class ARESdevice():
|
||||
rTrg=p['rTrg']
|
||||
|
||||
aArm=p['aArm']
|
||||
a2Th=p['a2Th']
|
||||
a2Th=180-p['a2Th'] #opposite direction zero at bottom
|
||||
aJFr=p['aJFr']
|
||||
aDet=p['aDet']
|
||||
aTrg=p['aTrg']
|
||||
@@ -330,8 +330,8 @@ class ARESdevice():
|
||||
qp.drawLine(0,-rArm,0,-rArm+tickL) #tick
|
||||
qp.setPen(penBk)
|
||||
qp.setBrush(QColor(255,0,0,128))
|
||||
qp.drawRect(-60, -150-rArm, 120, 150) # 2th mount sample
|
||||
qp.drawRect(-300, -600-rArm, 600, 450) # 2th mount sample
|
||||
qp.drawRect(-60, -150-rArm, 120, 150) # tube
|
||||
qp.drawRect(-300, -600-rArm, 600, 450) # grating chamber
|
||||
|
||||
#--- 2-theta devices ---
|
||||
qp.setTransform(tf2Th)
|
||||
@@ -346,9 +346,9 @@ class ARESdevice():
|
||||
qp.setTransform(tf2Th);qp.translate(-20,-r2Th-40);qp.rotate(-2)
|
||||
qp.drawRect(-30, 0, 30, 310) # foc. mirror 2
|
||||
|
||||
qp.setTransform(tf2Th);qp.rotate(20);qp.translate(-diW/2,-r2Th);
|
||||
qp.setTransform(tf2Th);qp.rotate(54);qp.translate(-diW/2,-r2Th);
|
||||
qp.drawRect(0, 0, diW, diH) # diode2
|
||||
qp.setTransform(tf2Th);qp.rotate(50);qp.translate(-diW/2,-r2Th);
|
||||
qp.setTransform(tf2Th);qp.rotate(80);qp.translate(-diW/2,-r2Th);
|
||||
qp.drawRect(0, 0, diW, diH) # diode3
|
||||
|
||||
#--- Jungfrau devices ---
|
||||
@@ -367,9 +367,9 @@ class ARESdevice():
|
||||
qp.drawLine(0,-rDet,0,-rDet+tickL) #tick
|
||||
qp.setPen(penBk)
|
||||
qp.setBrush(QColor(0,0,255,192))
|
||||
qp.setTransform(tfDet);qp.rotate(10);qp.translate(-diW/2,-rDet);
|
||||
qp.setTransform(tfDet);qp.rotate(165.4);qp.translate(-diW/2,-rDet);
|
||||
qp.drawRect(0, 0, diW, diH) # diode1
|
||||
qp.setTransform(tfDet);qp.rotate(40);qp.translate(0,-rDet+miW/2);qp.rotate(-45)
|
||||
qp.setTransform(tfDet);qp.rotate(181);qp.translate(0,-rDet+miW/2);qp.rotate(-45)
|
||||
qp.drawRect(-int(miW/2), 0, miW, miH) # mirror1
|
||||
|
||||
|
||||
|
||||
@@ -47,6 +47,9 @@ from RIXSgirder import WndGirderRIXS
|
||||
import sys, logging, copy, re
|
||||
import epics
|
||||
|
||||
if sys.version_info[0] < 3 or sys.version_info[1] < 6:
|
||||
print(f"Must be using Python 3.6 or newer. Try e.g. /opt/gfa/python-3.8/latest/bin/python /sf/furka/bin/RIXSconfig")
|
||||
|
||||
_log=logging.getLogger(__name__)
|
||||
|
||||
def obj_info(obj,p=''):
|
||||
@@ -460,10 +463,12 @@ class RIXSdevice():
|
||||
degArm=90-aa+90-bb
|
||||
radArm=np.deg2rad(degArm)
|
||||
gtz=r1
|
||||
grx=90-aa
|
||||
#grx=np.sin(np.deg2rad(90-aa))*200 # TODO: check angle to distance conversion
|
||||
grx=aa-90
|
||||
dtz=r1+np.cos(radArm)*r2
|
||||
dty1=dty2=np.sin(radArm)*r2
|
||||
drx=90-aa+90-bb+cc-34
|
||||
#drx=np.sin(np.deg2rad(90-aa+90-bb+cc-34))*200 # TODO: check angle to distance conversion
|
||||
drx=90-aa+90-bb+cc
|
||||
dd=cc-34 # angle of bellow to detector
|
||||
|
||||
geo.update({
|
||||
@@ -518,12 +523,15 @@ class RIXSdevice():
|
||||
r2=(x**2+y**2)**.5
|
||||
radArm=np.arctan2(y,x)
|
||||
degArm=np.rad2deg(radArm)
|
||||
aa=90-grx
|
||||
|
||||
#aa=90-np.rad2deg(np.arcsin(grx/200)) # TODO: check angle to distance conversion
|
||||
aa=90+grx
|
||||
#degArm=90-aa+90-bb
|
||||
bb=90-aa+90-degArm
|
||||
#drx=90-aa+90-bb+cc-34
|
||||
#cc=drx-90+aa-90+bb+34
|
||||
cc=drx-degArm+34
|
||||
#cc=np.rad2deg(np.arcsin(drx/200))-degArm+34 # TODO: check angle to distance conversion
|
||||
cc=drx-degArm
|
||||
|
||||
geo.update({
|
||||
'r1':r1,
|
||||
@@ -1115,6 +1123,8 @@ class WndVars(QWidget):
|
||||
defaultButton=QMessageBox.No,
|
||||
)
|
||||
if btn!=QMessageBox.Yes: return
|
||||
_log.info('for safty reason the program will not move')
|
||||
return
|
||||
|
||||
geo=dev._geo
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user