初始化zmq 项目
This commit is contained in:
35
runDecoder.py
Normal file
35
runDecoder.py
Normal file
@@ -0,0 +1,35 @@
|
||||
import matplotlib
|
||||
matplotlib.use('Agg')
|
||||
import argparse
|
||||
import sys
|
||||
import time
|
||||
from Decoder import Decoder_main
|
||||
from PubLibrary.RunOnce import is_program_running
|
||||
|
||||
if __name__ == "__main__":
|
||||
if not is_program_running():
|
||||
# 解析命令行参数
|
||||
parser = argparse.ArgumentParser(description="EEG Decoder Application")
|
||||
parser.add_argument('-dt', '--device-type', type=int, default=None, help="Device Type")
|
||||
parser.add_argument('-dh', '--device-host', type=str, default=None, help="Device Host IP")
|
||||
parser.add_argument('-dp', '--device-port', type=int, default=None, help="Device Port")
|
||||
parser.add_argument('-uh', '--upper-host', type=str, default=None, help="Upper Computer Host IP")
|
||||
parser.add_argument('-up', '--upper-port', type=int, default=None, help="Upper Computer Port")
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
decoder = Decoder_main()
|
||||
decoder.connect(
|
||||
device_type=args.device_type,
|
||||
device_host=args.device_host,
|
||||
device_port=args.device_port,
|
||||
upper_host=args.upper_host,
|
||||
upper_port=args.upper_port
|
||||
)
|
||||
|
||||
try:
|
||||
decoder.start()
|
||||
while not decoder.zmqServer.IsExitApp:
|
||||
time.sleep(1)
|
||||
except KeyboardInterrupt:
|
||||
decoder.stop()
|
||||
Reference in New Issue
Block a user