forked from openlp/openlp
Fix unlock send queue
This commit is contained in:
parent
c064a17ece
commit
e4926416f8
@ -431,10 +431,10 @@ class PJLink1(QTcpSocket):
|
|||||||
self.send_queue = []
|
self.send_queue = []
|
||||||
return
|
return
|
||||||
self.projectorNetwork.emit(S_NETWORK_SENDING)
|
self.projectorNetwork.emit(S_NETWORK_SENDING)
|
||||||
log.debug('(%s) send_command(): Sending cmd="%s" opts="%s" %s' % (self.ip,
|
log.debug('(%s) send_command(): Building cmd="%s" opts="%s" %s' % (self.ip,
|
||||||
cmd,
|
cmd,
|
||||||
opts,
|
opts,
|
||||||
'' if salt is None else 'with hash'))
|
'' if salt is None else 'with hash'))
|
||||||
if salt is None:
|
if salt is None:
|
||||||
out = '%s%s %s%s' % (PJLINK_HEADER, cmd, opts, CR)
|
out = '%s%s %s%s' % (PJLINK_HEADER, cmd, opts, CR)
|
||||||
else:
|
else:
|
||||||
@ -442,11 +442,18 @@ class PJLink1(QTcpSocket):
|
|||||||
if out in self.send_queue:
|
if out in self.send_queue:
|
||||||
# Already there, so don't add
|
# Already there, so don't add
|
||||||
log.debug('(%s) send_command(out=%s) Already in queue - skipping' % (self.ip, out.strip()))
|
log.debug('(%s) send_command(out=%s) Already in queue - skipping' % (self.ip, out.strip()))
|
||||||
elif not queue and len(self.send_queue) == 0 and not self.send_busy:
|
elif not queue and len(self.send_queue) == 0:
|
||||||
|
|
||||||
return self._send_string(out)
|
return self._send_string(out)
|
||||||
else:
|
else:
|
||||||
|
log.debug('(%s) send_command(out=%s) adding to queue' % (self.ip, out.strip()))
|
||||||
self.send_queue.append(out)
|
self.send_queue.append(out)
|
||||||
self.projectorReceivedData.emit()
|
if not self.send_busy:
|
||||||
|
self.projectorReceivedData.emit()
|
||||||
|
log.debug('(%s) send_command(): send_busy is %s' % (self.ip, self.send_busy))
|
||||||
|
if not self.send_busy:
|
||||||
|
log.debug('(%s) send_command() calling _send_string()')
|
||||||
|
self._send_string()
|
||||||
|
|
||||||
@pyqtSlot()
|
@pyqtSlot()
|
||||||
def _send_command(self):
|
def _send_command(self):
|
||||||
@ -519,17 +526,21 @@ class PJLink1(QTcpSocket):
|
|||||||
# Projector/display error
|
# Projector/display error
|
||||||
self.change_status(E_PROJECTOR)
|
self.change_status(E_PROJECTOR)
|
||||||
self.projectorReceivedData.emit()
|
self.projectorReceivedData.emit()
|
||||||
|
self.send_busy = False
|
||||||
|
return
|
||||||
# Command succeeded - no extra information
|
# Command succeeded - no extra information
|
||||||
if data.upper() == 'OK':
|
elif data.upper() == 'OK':
|
||||||
log.debug('(%s) Command returned OK' % self.ip)
|
log.debug('(%s) Command returned OK' % self.ip)
|
||||||
# A command returned successfully, recheck data
|
# A command returned successfully, recheck data
|
||||||
self.projectorReceivedData.emit()
|
self.projectorReceivedData.emit()
|
||||||
|
self.send_busy = False
|
||||||
|
return
|
||||||
|
|
||||||
if cmd in self.PJLINK1_FUNC:
|
if cmd in self.PJLINK1_FUNC:
|
||||||
self.PJLINK1_FUNC[cmd](data)
|
self.PJLINK1_FUNC[cmd](data)
|
||||||
else:
|
else:
|
||||||
log.warn('(%s) Invalid command %s' % (self.ip, cmd))
|
log.warn('(%s) Invalid command %s' % (self.ip, cmd))
|
||||||
|
self.send_busy = False
|
||||||
self.projectorReceivedData.emit()
|
self.projectorReceivedData.emit()
|
||||||
|
|
||||||
def process_lamp(self, data):
|
def process_lamp(self, data):
|
||||||
|
Loading…
Reference in New Issue
Block a user