예제 #1
0
def setProposalID(proposalID):
  if (getProposalID() != proposalID): #proposalID changed - create a new visit.
    print("you changed proposals! " + str(proposalID))
    try:
      visitName = ispybLib.createVisit(proposalID)
    except:
      visitName = "999999-1234"
      print("ispyb error")
    setVisitName(visitName)
  db_lib.setBeamlineConfigParam(beamline,"proposal",proposalID)
예제 #2
0
파일: daq_utils.py 프로젝트: stumyers/lsdc
def setProposalID(proposalID, createVisit=True):
    if (getProposalID() !=
            proposalID):  #proposalID changed - create a new visit.
        logger.info("you changed proposals! " + str(proposalID))
        try:
            if (createVisit):
                visitName = ispybLib.createVisit(proposalID)
                db_lib.setBeamlineConfigParam(beamline, "proposal", proposalID)
            else:
                visitName, visitNum = ispybLib.createVisitName(proposalID)
        except Exception as e:
            visitName = "999999-1234"
            logger.error("ispyb error in set proposal. Error: %s" % e)
        setVisitName(visitName)
예제 #3
0
def setProposalID(
    proposalID,
    createVisit=True
):  # TODO JA proposalID implies a database ID, which it is not (just proposal number). Misleading
    if (getProposalID() !=
            proposalID):  #proposalID changed - create a new visit.
        logger.info("you changed proposals! " + str(proposalID))
        logger.info(
            'ignoring createVisit for now - ISPyB required to properly account for visit numbers'
        )
        try:
            visitName, visitNum = createVisitName(proposalID)
            db_lib.setBeamlineConfigParam(beamline, "proposal", proposalID)
        except Exception as e:
            visitName = "999999-1234"
            logger.error("error in set proposal. Error: %s" % e)
        setVisitName(visitName)
예제 #4
0
파일: daq_utils.py 프로젝트: stumyers/lsdc
def setVisitName(visitName):
    return db_lib.setBeamlineConfigParam(beamline, "visitName", visitName)
예제 #5
0
파일: daq_utils.py 프로젝트: stumyers/lsdc
def setBlConfig(param, value):
    db_lib.setBeamlineConfigParam(beamline, param, value)
예제 #6
0
import db_lib
import time
import os
import string
import sys

beamline_id = sys.argv[1]
beamlineConfigList = db_lib.getAllBeamlineConfigParams(beamline_id)
tmpFileName = "/tmp/blConfig"+str(time.time())
tmpConfigFile = open(tmpFileName,"w+")
for i in range (0,len(beamlineConfigList)):
  infoName = beamlineConfigList[i]['info_name']
  info = beamlineConfigList[i]['info']
  if ("val" in info.keys()):
    tmpConfigFile.write(infoName + " " + str(info["val"]) + "\n")
tmpConfigFile.close()
#exit(0)
comm_s = "emacs -nw " + tmpFileName
os.system(comm_s)
tmpConfigFile = open(tmpFileName,"r")
for line in tmpConfigFile.readlines():
  print line
  (key,val) = line.split()
#  (key,val) = string.split(line)  
  db_lib.setBeamlineConfigParam(beamline_id, key, val)
tmpConfigFile.close()
#os.system("rm " + tmpFileName)



예제 #7
0
def setVisitName(visitName):
  return db_lib.setBeamlineConfigParam(beamline,"visitName",visitName)