passed += 1 else: print "FAIL" print "-------------------------------------------------------" (xpos,ypos) = DataReadWrite.getLastPosition() print "getLastPosition() result -> xpos: ",xpos, "ypos: ", ypos test += 1 if (xpos>0 and ypos>0): print "PASS" passed += 1 else: print "FAIL" print "-------------------------------------------------------" value=DataReadWrite.openBalanceDoor() print "openBalanceDoor() result ->",value test += 1 if value==True: print "PASS" passed += 1 else: print "FAIL" print "-------------------------------------------------------" value=DataReadWrite.closeBalanceDoor() print "closeBalanceDoor() result ->",value test += 1 if value==True: print "PASS" passed += 1
runID=1 startTime=datetime.today() endPoint=timedelta(minutes=duration) endTime=startTime+endPoint count=0 weight=float(0.0) value=float(0.0) a = array([]) DataReadWrite.closeBalanceDoor() while datetime.today() < endTime: timeLeft=endTime-datetime.today() print "Time left: ", (int(timeLeft.seconds/60)) weight=DataReadWrite.readStandardBalance() print "Weight: %f" % (float(weight)) if weight>0: a=append(a,float(weight)) print "Length: ",a.size averageWeight=mean(a) stdevWeight=std(a) print( "The average weight of crucible #%d is: %f with stdev of: %f" % (position, averageWeight,stdevWeight)) ## now update crucible position record now = datetime.today() today = now.strftime("%m-%d-%y %H:%M:%S") sleep(loggingInterval) DataReadWrite.openBalanceDoor() position=position+1