Skip to content
This repository has been archived by the owner on May 4, 2021. It is now read-only.

Commit

Permalink
Version 10.06
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmonk committed Oct 26, 2016
1 parent 6380d34 commit 5a499e9
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 1,277 deletions.
2 changes: 1 addition & 1 deletion Code/Init.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
DEBUG = False
VERSION = "10.04"
VERSION = "10.06"

import os
import sys
Expand Down
4 changes: 2 additions & 2 deletions Code/QT/Tablero.py
Original file line number Diff line number Diff line change
Expand Up @@ -561,11 +561,11 @@ def lanzaMenuVisual(self, siIzquierdo):
# menu.separador()

if not self.siTableroDirector():
menu.opcion("director", _("Director") + " [D]", Iconos.Director())
menu.opcion("director", _("Director") + " [%s-D]" % _("ALT"), Iconos.Director())
menu.separador()

if self.siPosibleRotarTablero:
menu.opcion("girar", _("Flip the board") + " [F]", Iconos.JS_Rotacion())
menu.opcion("girar", _("Flip the board") + " [%s-F]" % _("ALT"), Iconos.JS_Rotacion())
menu.separador()

smenu = menu.submenu(_("Default"), Iconos.Defecto())
Expand Down
37 changes: 19 additions & 18 deletions Code/XMotor.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ def xpr(line):
class Engine(QtCore.QThread):
def __init__(self, exe, priority, args):
QtCore.QThread.__init__(self)
self.pid = None
self.exe = os.path.abspath(exe)
self.direxe = os.path.dirname(exe)
self.priority = priority
Expand Down Expand Up @@ -68,12 +69,6 @@ def close(self):
self.working = False
self.wait()

def waitForStarting(self, max_time):
iniTiempo = time.time()
while self.starting and (time.time()-iniTiempo) < max_time:
self.wait(90)
return not self.starting

def run(self):
self.process = QtCore.QProcess()
self.process.setWorkingDirectory(self.direxe)
Expand Down Expand Up @@ -116,23 +111,29 @@ def __init__(self, nombre, exe, liOpcionesUCI=None, nMultiPV=0, priority=PRIORIT
self.ponder = False
self.pondering = False

self.engine = Engine(exe, priority, args)
self.engine.start()
if not self.engine.waitForStarting(3.0):
self.uci_ok = False
self.uci_lines = []
self.engine.close()
return

self.pid = self.engine.pid

self.lockAC = True
self.is_white = True

self.guiDispatch = None
self.ultDispatch = 0
self.minDispatch = 1.0 # segundos
self.whoDispatch = nombre
self.is_white = True
self.uci_ok = False
self.pid = None

if not os.path.isfile(exe):
return

self.engine = Engine(exe, priority, args)
self.engine.start()

time.sleep(0.01)
n = 100
while self.engine.starting and n:
time.sleep(0.1 if n > 50 else 0.3)
n-= 1

self.lockAC = True
self.pid = self.engine.pid

self.order_uci()

Expand Down
Loading

0 comments on commit 5a499e9

Please sign in to comment.