Skip to content

Commit

Permalink
Store specification string in array re #6755
Browse files Browse the repository at this point in the history
The array currently has no more than one element. More will be added in later work.

Signed-off-by: Karl Palmen <karl.palmen@stfc.ac.uk>
  • Loading branch information
KarlPalmen committed Apr 2, 2013
1 parent 0781dea commit 5c675f0
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Code/Mantid/scripts/Calibration/tube_spec.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self,ws):
self.ws = ws
self.inst = ws.getInstrument()
self.numTubes = 0
self.tubeSpecString = ""
self.specComponentArray = []
self.component = 0
self.minNumDetsInTube = 200
self.tubes = []
Expand All @@ -40,7 +40,7 @@ def setTubeSpecByString(self, tubeSpecString ):
If the specification is not unique, the first found will be used and there will
be no error message. So if in doubt don't skip a step.
"""
self.specString = tubeSpecString
self.specComponentArray.append(tubeSpecString)
self.delimiter = '/' # delimiter between parts of string in tree
self.numTubes = -1 # Negative value forces tubes to be searched and counted

Expand Down Expand Up @@ -108,9 +108,9 @@ def getComponent ( self ):
return self.component

# We look for the component
print "Looking for", self.specString,
print "Looking for", self.specComponentArray[0],

comp = self.inst.getComponentByName(self.specString)
comp = self.inst.getComponentByName(self.specComponentArray[0])

if( comp ):
self.component = comp
Expand Down Expand Up @@ -156,7 +156,7 @@ def getDetectorInfoFromTube( self, tubeIx ):
#print "First dectector ", firstDet," Last detector ", firstDet+numDet-1, "Number of detectors ", numDet
#print "First dectector ", firstDet," Last detector ", comp[numDet-1].getID()
else:
print self.specString, tubeIx, "not found"
print self.specComponentArray[0], tubeIx, "not found"
return 0, 0, 1

return firstDet, numDet, step
Expand Down Expand Up @@ -184,7 +184,7 @@ def getTubeLength( self, tubeIx ):
numDet = comp.nelements()
return comp[0].getDistance( comp[numDet-1] )
else:
print self.specString, tubeIx, "not found"
print self.specComponentArray[0], tubeIx, "not found"
return 0.0

def getTubeName ( self, tubeIx ):
Expand All @@ -210,7 +210,7 @@ def getTubeName ( self, tubeIx ):
if(comp != 0):
return comp.getFullName()
else:
print self.specString, tubeIx, "not found"
print self.specComponentArray[0], tubeIx, "not found"
return "Unknown"


Expand Down

0 comments on commit 5c675f0

Please sign in to comment.