Example #1
0
 def setTimes(self,time,previous=True):
     if previous:
         splitnum = self.state.splitnum - 1
     else:
         splitnum = self.state.splitnum
     self.info.configure(text=\
         timeh.timeToString(\
             timeh.difference(
                 time,\
                 self.state.currentComparison.segments[splitnum]\
             ),\
             {\
                 "showSign": True, \
                 "precision": self.config["precision"],\
                 "noPrecisionOnMinute": self.config["noPrecisionOnMinute"]\
             }\
         )\
         +" / "\
         +timeh.timeToString(\
             timeh.difference(\
                 self.state.currentComparison.segments[splitnum],\
                 self.state.comparisons[0].segments[splitnum]\
             ),\
             {\
                 "precision": self.config["precision"],\
                 "noPrecisionOnMinute": self.config["noPrecisionOnMinute"]\
             }\
         )\
     )
     if previous:
         self.info.configure(fg=self.setPreviousColour())
     else:
         self.info.configure(fg=self.setCurrentColour())
Example #2
0
 def showCurrentSplitDiff(self):
     self.rows[self.splits.activeIndex].setDiff(\
         text=timeh.timeToString(\
             timeh.difference(self.state.totalTime,self.state.currentComparison.totals[self.state.splitnum]),\
             {\
                 "showSign": True,\
                 "precision": self.config["diff"]["precision"],\
                 "noPrecisionOnMinute": self.config["diff"]["noPrecisionOnMinute"]\
             }\
         ),\
         fg=self.getCurrentDiffColour(\
             timeh.difference(self.state.segmentTime,self.state.currentComparison.segments[self.state.splitnum]), \
             timeh.difference(self.state.totalTime,self.state.currentComparison.totals[self.state.splitnum])\
         )\
     )
Example #3
0
 def updateGroupTimer(self):
     for i in range(len(self.splits.currentSplits)):
         split = self.splits.currentSplits[i]
         if self.splits.typeChecker.isGroup(split) and split.open:
             self.rows[i].setComparison(\
                 text=self.formatComparison(timeh.difference(self.state.totalTime,self.splits.groupStart)),\
                 fg="grey"
             )
             break
Example #4
0
 def setMainDiffs(self):
     for i in range(self.numRows-1):
         split = self.splits.currentSplits[i]
         if self.splits.typeChecker.isEmpty(split):
             self.rows[i].setDiff(text="")
         elif self.splits.typeChecker.isGroup(split):
             if (split.end < self.state.splitnum):
                 if split.start > 0:
                     groupChange = timeh.difference(\
                         timeh.difference(\
                             self.state.currentRun.totals[split.end],\
                             self.state.currentRun.totals[split.start]\
                         ),\
                         timeh.difference(\
                             self.state.currentComparison.totals[split.end],\
                             self.state.currentComparison.totals[split.start]\
                         )\
                     )
                     if timeh.isBlank(groupChange):
                         diffColour = self.config["diff"]["colours"]["skipped"]
                     else:
                         diffColour=self.getCurrentDiffColour(\
                             groupChange,\
                             self.state.currentComparison.totalDiffs[split.end]\
                         )
                 else:
                     diffColour=self.getCurrentDiffColour(\
                         timeh.blank(),\
                         self.state.currentComparison.totalDiffs[split.end]\
                     )
                 self.rows[i].setDiff(\
                     text=self.formatDiff(self.state.currentComparison.totalDiffs[split.end]),\
                     fg=diffColour\
                 )
             else:
                 self.rows[i].setDiff(text="")
         else:
             if (split.index < self.state.splitnum):
                 self.rows[i].setDiff(\
                     text=self.formatDiff(self.state.currentComparison.totalDiffs[split.index]),\
                     fg=self.findDiffColour(split.index)\
                 )
             else:
                 self.rows[i].setDiff(text="")
Example #5
0
 def setInfo(self):
     self.info.configure(text=timeh.timeToString(\
         timeh.difference(\
             self.state.currentComparison.segments[self.state.splitnum],\
             self.state.comparisons[0].segments[self.state.splitnum]\
         ),\
         {\
             "precision": self.config["precision"],\
             "noPrecisionOnMinute": self.config["noPrecisionOnMinute"]\
         }\
     ))
Example #6
0
 def frameUpdate(self):
     if self.state.runEnded:
         return
     if self.shouldHide():
         self.hide()
         return
     if not timeh.greater(
             self.state.comparisons[0].segments[self.state.splitnum],
             self.state.segmentTime):
         self.info.configure(
             text=\
                 timeh.timeToString(\
                     timeh.add(\
                         timeh.difference(self.state.segmentTime,self.state.comparisons[0].segments[self.state.splitnum]),\
                         self.state.bptList.total
                     ), \
                     {\
                         "precision": self.config["precision"]\
                     }\
                 )\
         )
Example #7
0
 def removeSegment(self,segment):
     del self.bests[segment]
     del self.totalBests[segment]
     if segment < len(self.bests):
         self.bests[segment] = timeh.difference(self.totalBests[segment],self.totalBests[segment-1])
Example #8
0
 def updateDiffs(self,splittime,totaltime):
     if (not(len(self.segmentDiffs)) or not timeh.isBlank(self.totalDiffs[-1])):
         self.segmentDiffs.append(timeh.difference(splittime,self.segments[len(self.segmentDiffs)]))
     else:
         self.segmentDiffs.append(timeh.blank())
     self.totalDiffs.append(timeh.difference(totaltime,self.totals[len(self.totalDiffs)]))