- for time in times:
- self.scanat(trials,vcc,gnd,time)
- sys.stdout.flush()
- count+=trials;
- if count>100:
- count=0;
- self.db.commit();
-
-
+ if not self.vccexplored(vcc):
+ print "Exploring vcc=%i" % vcc;
+ sys.stdout.flush();
+ for time in times:
+ self.scanat(trials,vcc,gnd,time)
+ sys.stdout.flush()
+ self.db.commit();
+ else:
+ print "Voltage %i already explored." % vcc;
+ sys.stdout.flush();
+ def vccexplored(self,vcc):
+ c=self.db.cursor();
+ c.execute("select vcc from glitches where vcc=? limit 1;",[vcc]);
+ rows=c.fetchall();
+ try:
+ c.next();
+ #This voltage has been explored, because no complete exception has been thrown.
+ return True;
+ except: #Voltage hasn't been explored
+ return False;
+