|
1 | 1 | import concore |
2 | | -import concore2 |
3 | 2 | import time |
4 | 3 | from osparc_control import CommandManifest |
5 | 4 | from osparc_control import CommandParameter |
|
27 | 26 | paired_transmitter.start_background_sync() |
28 | 27 |
|
29 | 28 | concore.delay = 0.07 |
30 | | -concore2.delay = 0.07 |
31 | | -concore2.inpath = concore.inpath |
32 | | -concore2.outpath = concore.outpath |
33 | | -concore2.simtime = 0 |
| 29 | +concore.simtime = 0 |
34 | 30 | concore.default_maxtime(100) |
35 | 31 | init_simtime_u = "[0.0, 0.0, 0.0]" |
36 | 32 | init_simtime_ym = "[0.0, 0.0, 0.0]" |
37 | 33 |
|
38 | 34 | u = concore.initval(init_simtime_u) |
39 | | -ym = concore2.initval(init_simtime_ym) |
40 | | -while(concore2.simtime<concore.maxtime): |
| 35 | +ym = concore.initval(init_simtime_ym) |
| 36 | +while(concore.simtime<concore.maxtime): |
41 | 37 | #while concore.unchanged(): |
42 | 38 | # u = concore.read(concore.iport['U1'],"u",init_simtime_u) |
43 | 39 | command_list = paired_transmitter.get_incoming_requests() |
|
53 | 49 | u = u[1:] |
54 | 50 | concore.write(concore.oport['U2'],"u",u) |
55 | 51 | print(u) |
56 | | - old2 = concore2.simtime |
57 | | - while concore2.unchanged() or concore2.simtime <= old2: |
58 | | - ym = concore2.read(concore.iport['Y2'],"ym",init_simtime_ym) |
59 | | - ym = [concore2.simtime]+ym |
| 52 | + old2 = float(concore.simtime) |
| 53 | + while concore.unchanged() or concore.simtime <= old2: |
| 54 | + ym = concore.read(concore.iport['Y2'],"ym",init_simtime_ym) |
| 55 | + ym = [concore.simtime]+ym |
60 | 56 | print(f"Replying to {command.action} with {ym}") |
61 | 57 | paired_transmitter.reply_to_command( |
62 | 58 | request_id=command.request_id, payload=ym) |
63 | 59 | else: |
64 | 60 | print("undefined action"+str(command.action)) |
65 | 61 | quit() |
66 | | - #concore2.write(concore.oport['Y1'],"ym",ym) |
67 | | - print("funbody u="+str(u)+" ym="+str(ym)+" time="+str(concore2.simtime)) |
| 62 | + #concore.write(concore.oport['Y1'],"ym",ym) |
| 63 | + print("funbody u="+str(u)+" ym="+str(ym)+" time="+str(concore.simtime)) |
68 | 64 | paired_transmitter.stop_background_sync() |
69 | 65 | print("retry="+str(concore.retrycount)) |
0 commit comments