From 27cd32809bbc71ed523afb7dc74f6b487a6c09c9 Mon Sep 17 00:00:00 2001 From: Andrew Walter Date: Mon, 8 Apr 2024 08:41:36 -0400 Subject: [PATCH] Adding vacuum and baffle PVs to the 'ARI M1' mirror caproto IOC --- .DS_Store | Bin 0 -> 6148 bytes .idea/.gitignore | 3 + .idea/ARI_SXN_SimBeamline.iml | 12 +++ .../inspectionProfiles/profiles_settings.xml | 6 ++ .idea/misc.xml | 7 ++ .idea/modules.xml | 8 ++ .idea/vcs.xml | 6 ++ src/.DS_Store | Bin 6148 -> 6148 bytes src/ari_sxn_simbeamline/.DS_Store | Bin 0 -> 6148 bytes .../Caproto_servers/Mirror_section.py | 86 ++++++++++++++++-- .../Mirror_section.cpython-312.pyc | Bin 0 -> 5424 bytes .../__pycache__/__init__.cpython-312.pyc | Bin 0 -> 496 bytes .../__pycache__/_version.cpython-312.pyc | Bin 0 -> 614 bytes src/ari_sxn_simbeamline/_version.py | 4 +- 14 files changed, 120 insertions(+), 12 deletions(-) create mode 100644 .DS_Store create mode 100644 .idea/.gitignore create mode 100644 .idea/ARI_SXN_SimBeamline.iml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/modules.xml create mode 100644 .idea/vcs.xml create mode 100644 src/ari_sxn_simbeamline/.DS_Store create mode 100644 src/ari_sxn_simbeamline/Caproto_servers/__pycache__/Mirror_section.cpython-312.pyc create mode 100644 src/ari_sxn_simbeamline/__pycache__/__init__.cpython-312.pyc create mode 100644 src/ari_sxn_simbeamline/__pycache__/_version.cpython-312.pyc diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..986c233cb5ea130c19009c432982fe520003e10c GIT binary patch literal 6148 zcmeHK%}T>S5Z<-brW7FuMUM+!3&tvy;w8lT0!H+pQWH}&7_%iw&7l->)fe(jd>&_Z zH(+VcB6bFLzxmzGevtiPjB#%o9WiDz#w=)v9F-ML%G6d^0oS4{O z2mJO1%UQ-A!}90%Cvjdl&KKWkG&i?eR?F&G_x`gi{URu)xff)&XkAH}gtZ=o*YUU< z**oVlErK{5XR08M#*lJ%6Q_|ZJvmLIT-EwIV70CG$ljaHdZ+!a7&!B;m<@VPSDYO8 z=kvC;dvJJmIeJN6Q~9phx5nF+dCu1H{0ZGhhw| ztFz`j(DI1^Vqlp8+#duqMAu-YQEeU2;q@8gO+*yX@hyQU47vs@jSvChx)e~Ca`VLC zx*Yt% + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..db8786c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..e965678 --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/.DS_Store b/src/.DS_Store index f1d33998cdf8bc0ad6771f2516610f47ff11ede9..306b3138f6c9e501af1a86020a48de19660ad030 100644 GIT binary patch delta 294 zcmZoMXfc=|#>B)qu~2NHo+2aj!~pA!7aACWj2^A}r1Ii|q@4UD1_p-hNd-BX#U%y? z*BF_YSyuu5=%;pof3CJzu~2NHo+2aT!~knX#>qTPS{!L9#mPze`8k^tnU}F_ZeU)_w3(fQ jp983Nb0PD0=E?jbx}1y*3=9W=m|?OFkM!mkktNIko6Z$k diff --git a/src/ari_sxn_simbeamline/.DS_Store b/src/ari_sxn_simbeamline/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..eb246b1902651fbe3795f33d8b3f2d1e329e4990 GIT binary patch literal 6148 zcmeHKyG{c^3>-s>NED=`++W}iRv~;rJ^+wFG$=tANPQLG#iucT2Lv7 zPX|Mc0K^5;VO+;7L2RBN_QEld8JZ=Pm{h9~!;;Q?tGZq|CMF$L!-v()RuhWF?L5Cl zIjkotN&zV_Rp30gEARie^dIK`DM>piAO-%F0=C#}H*3C9_14+Td9Q8sd%D+r(%rZY o3PZGGVzgs!yd7UfQPwqI^LZ~E6NAot(24pPa9w0l;I9?<0>|qY!2kdN literal 0 HcmV?d00001 diff --git a/src/ari_sxn_simbeamline/Caproto_servers/Mirror_section.py b/src/ari_sxn_simbeamline/Caproto_servers/Mirror_section.py index d8e3d29..9fb6f0b 100644 --- a/src/ari_sxn_simbeamline/Caproto_servers/Mirror_section.py +++ b/src/ari_sxn_simbeamline/Caproto_servers/Mirror_section.py @@ -3,10 +3,66 @@ Caproto IOC servers """ from caproto.ioc_examples.fake_motor_record import FakeMotor -from caproto.server import PVGroup, SubGroup, ioc_arg_parser, run +from caproto.server import PVGroup, SubGroup, pvproperty, ioc_arg_parser, run from textwrap import dedent +class FourBladeCurrent(PVGroup): + """ + A PVGroup that generates the PVs associated with the 4 blade electrometer. + + This class should be used to define the PVs for the 4 blade electrometers used + in the ARI and SXN beamlines for the Baffle slits. + + TODO: + 1. Work out how we want to update the returned current values based on the position + of the blades and the upstream mirrors. + """ + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # call the PVGroup __init__ function + + # Add the current PVs + top = pvproperty(value=3E-6, name=':top', read_only=True) + bottom = pvproperty(value=3E-6, name=':bottom', read_only=True) + inboard = pvproperty(value=3E-6, name=':inboard', read_only=True) + outboard = pvproperty(value=3E-6, name=':outboard', read_only=True) + + +class BaffleSlit(PVGroup): + """ + A PVGroup that generates the PVs associated with the ARI M1 mirror system. + + This class should be used to define the Baffle Slit system PVs for the baffle slits + used in the ARI and SXN beamlines. It will consist of PVs for each of the associated + motors for each baffle as well as the photo-current PVs from each of the blades. + + TODO: + 1. Work out how we want to define the area detector PVs, including how we 'update' + the photo-current PVs based from each of the blades when the mirror and/or baffles + are moved. + """ + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) # call the PVGroup __init__ function + + # Add the baffle motor PVs. + top = SubGroup(FakeMotor, velocity=0.1, precision=6E-3, acceleration=1.0, + resolution=6E-3, user_limits=(-1, 20), tick_rate_hz=10., + prefix=':top') + bottom = SubGroup(FakeMotor, velocity=0.1, precision=6E-3, acceleration=1.0, + resolution=6E-3, user_limits=(-20, 1), tick_rate_hz=10., + prefix=':bottom') + inboard = SubGroup(FakeMotor, velocity=0.1, precision=6E-3, acceleration=1.0, + resolution=6E-3, user_limits=(-20, 1), tick_rate_hz=10., + prefix=':inboard') + outboard = SubGroup(FakeMotor, velocity=0.1, precision=6E-3, acceleration=1.0, + resolution=6E-3, user_limits=(-1, 20), tick_rate_hz=10., + prefix=':outboard') + + current = SubGroup(FourBladeCurrent, prefix=':current') + + class AriM1Mirror(PVGroup): """ A PVGroup that generates the PVs associated with the ARI M1 mirror system. @@ -21,40 +77,50 @@ class AriM1Mirror(PVGroup): - This may help create a cohesive connection between them but also blurs the lines between vacuum sections and physical devices. 2. Add the vacuum component (gauges, pumps, valves, ....). - - This may require defining vacuum component PVGroups. + - Temporary read only PVs have been created but I need to see what other PVs + are associated with this hardware that we may want to simulate. Parameters ---------- *args : list - The arguments passed to the PVGroup parent class + The arguments passed to the PVGroup parent class. **kwargs : list, optional - The Keyword arguments passed to the PVGroup parent class + The Keyword arguments passed to the PVGroup parent class. """ def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) # call the PVGroup __init__ function + # Add the mirror motor PVs. Ry_coarse = SubGroup(FakeMotor, velocity=0.1, precision=6E-5, acceleration=1.0, resolution=6E-5, user_limits=(-3.15, -1.15), tick_rate_hz=10., - prefix='Ry_coarse') + prefix=':Ry_coarse') Ry_fine = SubGroup(FakeMotor, velocity=0.1, precision=6E-7, acceleration=1.0, resolution=6E-7, user_limits=(-0.03, 0.03), tick_rate_hz=10., - prefix='Ry_fine') + prefix=':Ry_fine') Rz = SubGroup(FakeMotor, velocity=0.1, precision=6E-5, acceleration=1.0, resolution=6E-5, user_limits=(-2.3, 2.3), tick_rate_hz=10., - prefix='Rz') + prefix=':Rz') x = SubGroup(FakeMotor, velocity=0.0001, precision=5., acceleration=1.0, resolution=5., user_limits=(-10000., 10000.), tick_rate_hz=1E-3, - prefix='x') + prefix=':x') y = SubGroup(FakeMotor, velocity=0.1, precision=5., acceleration=1.0, resolution=5., user_limits=(-10000., 10000.), tick_rate_hz=10., - prefix='y') + prefix=':y') + + # Add the mirror chamber vacuum PVs. + ccg = pvproperty(value=3E-10, name=':ccg', read_only=True) + tcg = pvproperty(value=1E-4, name=':tcg', read_only=True) + ip = pvproperty(value=4E-10, name=':ip', read_only=True) + + # Add the baffle slit PVs. + baffle = SubGroup(BaffleSlit, prefix=':baffle') # Add some code to start a version of the server if this file is 'run'. if __name__ == "__main__": ioc_options, run_options = ioc_arg_parser( - default_prefix="ARI:M1:", + default_prefix="ARI_M1", desc=dedent(AriM1Mirror.__doc__)) ioc = AriM1Mirror(**ioc_options) run(ioc.pvdb, **run_options) diff --git a/src/ari_sxn_simbeamline/Caproto_servers/__pycache__/Mirror_section.cpython-312.pyc b/src/ari_sxn_simbeamline/Caproto_servers/__pycache__/Mirror_section.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..f84d0a0f27a9dd9851ce69f1ad23d6c116856b86 GIT binary patch literal 5424 zcmc&&Z)_Y#72mx(-=96-*{it**+5?O9YXAptS_31_|U3m9Uk3@F!#hsFC<$gak=zRA&XMprEQM9}?n9l|h2v z%uu+ zP1$CwN$E|7K$>0`UlFq{=*LORrS7`LelsUxRx_I=3e|KqooSvfNEZr*E$0lA$diU? z%9>SjRHG!@R*}egQX=cMRPSm1ll!!F! zPe1+quxt}LL8vXg&t%AmZsMeRnT&!N%`~_%pP?HctBiBju2i1DU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zt0ieGG@}CTd4? zW4`=u==`)RPPt;$&tR}A(il`Bqs+Z9@)>WRM>^{vY))Bq96$TdsJOG<0%!d>&sn#0 z&UG$~EuUDi*ShyEm2Qn)T$B6YQ(O9HPJhfFkKQ^rw#gw&Pt0cKwWSLy;kE5M7rp_H z-`R!5l00)9ixVxgo%0u$D5%@IZuK2rIkDEU4dg`E%&~wxwsidFm`@(ABTFom`uzOF za@(qO1gVtNR-afUTIZggCri$1;t<~nLB*wo&eha`t0z6r&(6%!#3KG{LTVUg$?)j@ zOvp_m_*E;Wqj+JJ8_|iaon2%mVnLF-NAvz%>SzBAktwxUHUVup{HcUQ6EU)aXbx|V zhfr=hnC#`vlx66YM_4T1q%l^pEX<8NWXhSOV4YxNJdfmo6gLnH*4!l9(0k^#o5Vj+ zwN4lmH&UL^$LU$Nn&*lvAKi!_@{->p^dh(N&6lsG%NF0k)<-wyH6Z2P)^&-w}RfOv4WXI;SOF8)x8G+vv2Gu(M+$G)}p z9d}Z#vuECJ>$%<5^Hz$5V{-59$hMg?vroZ_$t|~~?zto?SSb>_7JfDUa{P8go;~wc NM82C8B3rq@{{iX(4paaD literal 0 HcmV?d00001 diff --git a/src/ari_sxn_simbeamline/__pycache__/__init__.cpython-312.pyc b/src/ari_sxn_simbeamline/__pycache__/__init__.cpython-312.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a99f9455390a4e1a2068df6fa89d1353e5fdac11 GIT binary patch literal 496 zcmZvXze;2=6vmS~f3Dmat+fj*EDp#-#7aaM6&4!{hea8LL!4wZkeg_dtB#$WPq4m$ z;Ir%-+)7xsuv5gw%5!zb%2R~zJNeE@et&0YGlF&3Z;vuc$iK==EBO@kiZz_=+ZPgmva#CUFtk7ObHgcW`7Ia=15z!w_ za_n6Bpq*uI#BdE0Rx(`mbsw_F3Z_HLmax`E5iuMdk+|xmlj*VrFp&VeowQ5=q#FX1 z8NjHBg;xN+hC}7dH0T>>eY5IeS{MUxPhQZHw?qCL*#gJUApFG#JKuK0B3CvB{!7P` z;)s7k&4V9u;WdOy3kW-<Xt3mO4Zv9SvOEClW6w@q(D-V#=hD5~e???YHWWo3P#4dsJg;V81|J%JL9e z7zfm%{KFxHM2+7nF{EP9ID7$T9Krd4(FyrvhJ_u1j*cvkB4XSNx