1
0
This commit is contained in:
2026-01-06 22:04:52 +08:00
parent 77cc14fa49
commit 07cc58fb36
3 changed files with 63 additions and 6 deletions

View File

@@ -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,