Script execution

This commit is contained in:
gac-x04sa
2019-02-26 15:27:05 +01:00
parent 75dca010de
commit a4d198c50e
+4 -5
View File
@@ -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