it works
This commit is contained in:
@@ -1,6 +1,31 @@
|
||||
from command_server import CommandServer, HandshakePayload, PixelKind
|
||||
import logging
|
||||
|
||||
|
||||
def receive_data() -> None:
|
||||
logging.info('Data received')
|
||||
|
||||
|
||||
def main():
|
||||
print("Hello from basalt-trainer!")
|
||||
server = CommandServer()
|
||||
|
||||
print(
|
||||
'Please launch BasaltPresenter now and then press Enter to continue.')
|
||||
input()
|
||||
|
||||
logging.info('Waiting BasaltPresenter...')
|
||||
server.wait_handshake(HandshakePayload(PixelKind.GRAY_U8, 600, 600))
|
||||
|
||||
logging.info('Start to running.')
|
||||
while True:
|
||||
if server.tick(receive_data, False):
|
||||
break
|
||||
|
||||
logging.info('Program stop.')
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
logging.basicConfig(level=logging.DEBUG,
|
||||
format='[%(asctime)s] [%(levelname)s] %(message)s',
|
||||
datefmt='%Y-%m-%d %H:%M:%S')
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user