Exemplo n.º 1
0
 def gridBotonDerecho(self, grid, fila, oColumna, modificadores):
     col = oColumna.clave
     if not col.startswith("BLOCK"):
         return
     num_block = int(col[5:])
     num_theme = fila
     block = self.tol.get_block(num_theme, num_block)
     litimes = block.times
     nmoves = block.num_moves()
     if not litimes and not block.reinits:
         return
     menu = QTVarios.LCMenu(self)
     menu.ponTipoLetra(nombre="Courier New", puntos=10)
     tt = 0
     d = {
         "0": Iconos.Gris32(),
         "1": Iconos.Amarillo32(),
         "2": Iconos.Naranja32(),
         "3": Iconos.Verde32(),
         "4": Iconos.Azul32(),
         "5": Iconos.Magenta32(),
         "6": Iconos.Rojo32(),
         "7": Iconos.Light32()
     }
     for segs, fecha in litimes:
         txt, ico = TurnOnLights.qualification(
             segs, self.tol.is_calculation_mode())
         menu.opcion(
             None, "%d-%02d-%02d %02d:%02d %6.02f  %6.02f  %s" %
             (fecha.year, fecha.month, fecha.day, fecha.hour, fecha.minute,
              segs, segs * nmoves, txt), d[ico])
         tt += segs * nmoves
     if litimes:
         menu.separador()
         menu.opcion(
             None,
             "%16s %6.02f" % (_("Average"), tt / (nmoves * len(litimes))))
         menu.separador()
     plant = "%16s %15.02f  %s"
     menu.opcion(
         None, plant %
         (_("Total time"), tt, time.strftime("%H:%M:%S", time.gmtime(tt))))
     if block.reinits:
         tr = 0.0
         for segs, fecha in block.reinits:
             tr += segs
         menu.separador()
         menu.opcion(
             None, plant % (_("Restarts"), tr,
                            time.strftime("%H:%M:%S", time.gmtime(tr))))
         menu.separador()
         menu.opcion(
             None,
             plant % (_("Working time"), tt + tr,
                      time.strftime("%H:%M:%S", time.gmtime(tt + tr))))
     menu.lanza()
Exemplo n.º 2
0
 def colors(self):
     menu = QTVarios.LCMenu(self)
     d = {
         "0": Iconos.Gris32(),
         "1": Iconos.Amarillo32(),
         "2": Iconos.Naranja32(),
         "3": Iconos.Verde32(),
         "4": Iconos.Azul32(),
         "5": Iconos.Magenta32(),
         "6": Iconos.Rojo32(),
         "7": Iconos.Light32()
     }
     for txt, key, secs in TurnOnLights.QUALIFICATIONS:
         menu.opcion(None, "%s < %0.2f\"" % (_F(txt), secs), d[key])
         menu.separador()
     menu.lanza()
 def colors(self):
     menu = QTVarios.LCMenu(self)
     d = {
         "0": Iconos.Gris32(),
         "1": Iconos.Amarillo32(),
         "2": Iconos.Naranja32(),
         "3": Iconos.Verde32(),
         "4": Iconos.Azul32(),
         "5": Iconos.Magenta32(),
         "6": Iconos.Rojo32(),
         "7": Iconos.Light32()
     }
     num, ultimo = TurnOnLights.numColorMinimum(self.tol)
     snum = str(num)
     for txt, key, secs in TurnOnLights.QUALIFICATIONS:
         rotulo = "%s < %0.2f\"" % (_F(txt), secs)
         if key == snum and not ultimo:
             rotulo += " = %s" % _("Minimum to access next level")
         menu.opcion(None, rotulo, d[key])
         menu.separador()
     menu.lanza()