Small fix in Experiment class (get_length() rturns correct time when called while in loop.
This commit is contained in:
		| @@ -558,7 +558,8 @@ class Experiment: | |||||||
|         #calculate the correct timelength also for unclosed loops, if there is no unclosed loop |         #calculate the correct timelength also for unclosed loops, if there is no unclosed loop | ||||||
|         #the timelength of this experiment is self.total_time[-1]. |         #the timelength of this experiment is self.total_time[-1]. | ||||||
|         for i in range(len(self.total_time)): |         for i in range(len(self.total_time)): | ||||||
|             timelength += self.total_time[i]*self.loop_iterations[i] |             timelength += self.total_time[i] | ||||||
|  |             timelength *= self.loop_iterations[i] | ||||||
|              |              | ||||||
|         return timelength |         return timelength | ||||||
|  |  | ||||||
| @@ -602,7 +603,7 @@ def self_test(): | |||||||
|     e.set_pts_local() |     e.set_pts_local() | ||||||
|     print e.write_xml_string() |     print e.write_xml_string() | ||||||
|      |      | ||||||
|     print e.get_timelength() |     print e.get_length() | ||||||
|  |  | ||||||
| if __name__ == '__main__': | if __name__ == '__main__': | ||||||
|     self_test() |     self_test() | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user