fix bug
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from command_server import CommandServer, HandshakePayload, PixelKind
|
||||
from while_stopper import WhileStopper
|
||||
import logging
|
||||
import signal
|
||||
|
||||
|
||||
def receive_data() -> None:
|
||||
@@ -9,20 +11,26 @@ def receive_data() -> None:
|
||||
def main():
|
||||
server = CommandServer()
|
||||
|
||||
print(
|
||||
'Please launch BasaltPresenter now and then press Enter to continue.')
|
||||
print('Please launch BasaltPresenter now.')
|
||||
print('Then press Enter to continue...')
|
||||
input()
|
||||
|
||||
logging.info('Waiting BasaltPresenter...')
|
||||
server.wait_handshake(HandshakePayload(PixelKind.GRAY_U8, 600, 600))
|
||||
|
||||
logging.info('Start to running.')
|
||||
stopper = WhileStopper()
|
||||
stopper.register()
|
||||
while True:
|
||||
if server.tick(receive_data, False):
|
||||
if server.tick(receive_data, stopper.is_stop_requested()):
|
||||
break
|
||||
stopper.unregister()
|
||||
|
||||
logging.info('Program stop.')
|
||||
|
||||
print('Press Enter to exit...')
|
||||
input()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.DEBUG,
|
||||
|
||||
Reference in New Issue
Block a user