コード例 #1
0
ファイル: daq_utils.py プロジェクト: jskinner53/lsdc
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
ファイル: configEdit.py プロジェクト: jskinner53/lsdc
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
ファイル: daq_utils.py プロジェクト: jskinner53/lsdc
def setVisitName(visitName):
  return db_lib.setBeamlineConfigParam(beamline,"visitName",visitName)