Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Choose the detector to use and move the detector stage #58

Merged
merged 15 commits into from
Nov 13, 2023
Merged
7 changes: 1 addition & 6 deletions src/mx_bluesky/I24/serial/dcid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
import re
import subprocess
import warnings
from enum import Enum
from functools import lru_cache

import requests

from mx_bluesky.I24.serial.parameters import SSXType
from mx_bluesky.I24.serial.setup_beamline import (
Detector,
Eiger,
Expand Down Expand Up @@ -53,11 +53,6 @@ def get_auth_header() -> dict:
return {"Authorization": "Bearer " + token}


class SSXType(Enum):
FIXED = "Serial Fixed"
EXTRUDER = "Serial Jet"


class DCID:
"""
Interfaces with ISPyB to allow ssx DCID/synchweb interaction.
Expand Down
139 changes: 139 additions & 0 deletions src/mx_bluesky/I24/serial/extruder/EX-gui-edm/DetStage.edl
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
4 0 1
beginScreenProperties
major 4
minor 0
release 1
x 3338
y 498
w 450
h 180
font "arial-medium-r-18.0"
ctlFont "arial-medium-r-18.0"
btnFont "arial-medium-r-18.0"
fgColor index 14
bgColor index 3
textColor index 14
ctlFgColor1 index 14
ctlFgColor2 index 0
ctlBgColor1 index 0
ctlBgColor2 index 14
topShadowColor index 0
botShadowColor index 14
title "Detector stage "
endScreenProperties

# (Text Monitor)
object activeXTextDspClass:noedit
beginObjectProperties
major 4
minor 6
release 0
x 251
y 139
w 160
h 21
controlPv "BL24I-EA-DET-01:Y"
font "arial-medium-r-18.0"
fgColor index 16
bgColor index 10
autoHeight
limitsFromDb
nullColor index 0
useHexPrefix
newPos
objType "monitors"
endObjectProperties

# (Static Text)
object activeXTextClass
beginObjectProperties
major 4
minor 1
release 1
x 28
y 139
w 193
h 21
font "arial-medium-r-18.0"
fgColor index 14
bgColor index 0
useDisplayBg
value {
"Detector stage position"
}
autoSize
endObjectProperties

# (Menu Mux PV)
object menuMuxPVClass
beginObjectProperties
major 4
minor 0
release 0
x 35
y 59
w 160
h 42
fgColour index 14
bgColour index 4
topShadowColour index 1
botShadowColour index 8
controlPv "BL24I-EA-IOC-12:GP15"
font "arial-medium-r-18.0"
numItems 2
symbolTag {
0 "Eiger"
1 "Pilatus"
}
symbol0 {
0 "E9M"
1 "P6M"
}
PV0 {
0 "eiger"
1 "pilatus"
}
endObjectProperties

# (Shell Command)
object shellCmdClass
beginObjectProperties
major 4
minor 3
release 0
x 251
y 59
w 160
h 42
fgColor index 14
bgColor index 49
topShadowColor index 0
botShadowColor index 14
font "arial-medium-r-18.0"
buttonLabel "Move Stage"
numCmds 1
command {
0 "python SCRIPTS_LOCATION/setup_beamline/setup_detector.py extruder"
}
endObjectProperties

# (Static Text)
object activeXTextClass
beginObjectProperties
major 4
minor 1
release 1
x 150
y 10
w 135
h 21
font "arial-bold-r-18.0"
fgColor index 14
bgColor index 0
useDisplayBg
value {
"Detector Stage"
}
autoSize
endObjectProperties

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ beginScreenProperties
major 4
minor 0
release 1
x 4241
y 52
x 3046
y 314
w 700
h 900
font "arial-medium-r-18.0"
Expand Down Expand Up @@ -1014,8 +1014,8 @@ beginObjectProperties
major 4
minor 0
release 0
x 11
y 610
x 10
y 611
w 680
h 252
lineColor index 9
Expand Down Expand Up @@ -1355,7 +1355,7 @@ beginObjectProperties
major 4
minor 1
release 1
x 307
x 304
y 689
w 35
h 18
Expand Down Expand Up @@ -1679,8 +1679,8 @@ beginObjectProperties
major 4
minor 1
release 0
x 499
y 818
x 466
y 819
w 43
h 25
fgColor index 25
Expand All @@ -1704,8 +1704,8 @@ beginObjectProperties
major 10
minor 0
release 0
x 405
y 784
x 375
y 785
w 83
h 30
controlPv "BL24I-EA-DET-01:Z.VAL"
Expand All @@ -1724,8 +1724,8 @@ beginObjectProperties
major 4
minor 1
release 0
x 547
y 818
x 513
y 819
w 43
h 25
fgColor index 25
Expand All @@ -1749,8 +1749,8 @@ beginObjectProperties
major 4
minor 1
release 1
x 340
y 763
x 304
y 758
w 149
h 18
font "arial-medium-r-16.0"
Expand All @@ -1769,8 +1769,8 @@ beginObjectProperties
major 4
minor 1
release 1
x 338
y 795
x 304
y 792
w 53
h 16
font "arial-medium-r-14.0"
Expand All @@ -1789,8 +1789,8 @@ beginObjectProperties
major 4
minor 1
release 1
x 348
y 822
x 304
y 823
w 42
h 16
font "arial-medium-r-14.0"
Expand All @@ -1809,7 +1809,7 @@ beginObjectProperties
major 4
minor 6
release 0
x 501
x 466
y 791
w 86
h 18
Expand All @@ -1832,7 +1832,7 @@ beginObjectProperties
major 10
minor 0
release 0
x 405
x 375
y 816
w 83
h 30
Expand All @@ -1852,7 +1852,7 @@ beginObjectProperties
major 4
minor 1
release 1
x 307
x 304
y 716
w 35
h 18
Expand Down Expand Up @@ -2252,3 +2252,26 @@ command {
}
endObjectProperties

# (Related Display)
object relatedDisplayClass
beginObjectProperties
major 4
minor 4
release 0
x 571
y 800
w 96
h 31
fgColor index 14
bgColor index 49
topShadowColor index 1
botShadowColor index 11
font "arial-medium-r-18.0"
buttonLabel "Detector"
numPvs 4
numDsps 1
displayFileName {
0 "EDM_LOCATION/DetStage.edl"
}
endObjectProperties

Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,12 @@
from time import sleep

from mx_bluesky.I24.serial import log
from mx_bluesky.I24.serial.dcid import DCID, SSXType
from mx_bluesky.I24.serial.dcid import DCID
from mx_bluesky.I24.serial.parameters import SSXType
from mx_bluesky.I24.serial.parameters.constants import PARAM_FILE_PATH
from mx_bluesky.I24.serial.setup_beamline import caget, caput, pv
from mx_bluesky.I24.serial.setup_beamline import setup_beamline as sup
from mx_bluesky.I24.serial.setup_beamline.setup_detector import get_detector_type
from mx_bluesky.I24.serial.write_nexus import call_nexgen

usage = "%(prog)s command [options]"
Expand Down Expand Up @@ -49,7 +51,7 @@ def initialise_extruderi24(args=None):
logger.info("Visit defined %s" % visit)

# Define detector in use
det_type = sup.get_detector_type()
det_type = get_detector_type()

caput(pv.ioc12_gp2, "test")
caput(pv.ioc12_gp3, "testrun")
Expand Down
Loading