Script execution
This commit is contained in:
@@ -109,7 +109,7 @@ def wait_for_file_size(filepath, size):
|
||||
filepath = os.path.abspath(filepath)
|
||||
# If the file doesn't exist, wait wait_time seconds and try again
|
||||
# until it's found.
|
||||
while not os.path.exists(filepath) and os.path.getsize(filepath) < size:
|
||||
while not os.path.exists(filepath) or size > os.path.getsize(filepath):
|
||||
time.sleep(wait_time)
|
||||
|
||||
|
||||
@@ -130,12 +130,11 @@ class Image(DeviceBase, Readable):
|
||||
def get_int(self, filename = None):
|
||||
if filename is None:
|
||||
filename = self.pixel.get_image_filename()
|
||||
print "Waiting image file: " , filename,
|
||||
|
||||
file_size = 4 * self.pixel.PIX_XDIM * self.pixel.PIX_YDIM
|
||||
print " size= ", file_size
|
||||
print "Waiting image file: " , filename, " size=", file_size
|
||||
wait_for_file_size(filename, file_size)
|
||||
|
||||
|
||||
|
||||
threshold1 = self.pixel.threshold1
|
||||
threshold2 = self.pixel.threshold2
|
||||
threshold3 = self.pixel.threshold3
|
||||
|
||||
Reference in New Issue
Block a user