|
1 | 1 | import concore |
2 | | -import concore2 |
3 | 2 | from osparc_control import PairedTransmitter |
4 | 3 | print("funcall 0mq") |
5 | 4 |
|
6 | 5 | concore.delay = 0.07 |
7 | | -concore2.delay = 0.07 |
8 | | -concore2.inpath = concore.inpath |
9 | | -concore2.outpath = concore.outpath |
10 | | -concore2.simtime = 0 |
| 6 | +concore.delay = 0.07 |
| 7 | +concore.inpath = concore.inpath |
| 8 | +concore.outpath = concore.outpath |
| 9 | +concore.simtime = 0 |
11 | 10 | concore.default_maxtime(100) |
12 | 11 | init_simtime_u = "[0.0, 0.0, 0.0]" |
13 | 12 | init_simtime_ym = "[0.0, 0.0, 0.0]" |
14 | 13 |
|
15 | 14 | u = concore.initval(init_simtime_u) |
16 | | -ym = concore2.initval(init_simtime_ym) |
| 15 | +ym = concore.initval(init_simtime_ym) |
17 | 16 | paired_transmitter = PairedTransmitter( |
18 | 17 | remote_host="localhost", exposed_commands=[], |
19 | 18 | remote_port=2345, listen_port=2346,) |
20 | 19 | paired_transmitter.start_background_sync() |
21 | 20 | try: |
22 | | - while(concore2.simtime<concore.maxtime): |
| 21 | + while(concore.simtime<concore.maxtime): |
23 | 22 | while concore.unchanged(): |
24 | 23 | u = concore.read(concore.iport['U'],"u",init_simtime_u) |
25 | 24 | print(u) |
26 | 25 | #concore.write(concore.oport['U1'],"u",u) |
27 | | - #old2 = concore2.simtime |
28 | | - #while concore2.unchanged() or concore2.simtime <= old2: |
29 | | - # ym = concore2.read(concore.iport['Y1'],"ym",init_simtime_ym) |
| 26 | + #old2 = concore.simtime |
| 27 | + #while concore.unchanged() or concore.simtime <= old2: |
| 28 | + # ym = concore.read(concore.iport['Y1'],"ym",init_simtime_ym) |
30 | 29 | ym = paired_transmitter.request_with_immediate_reply( |
31 | 30 | "fun", timeout=10.0, params={"u": [concore.simtime]+u}) |
32 | | - concore2.simtime = ym[0] |
| 31 | + concore.simtime = ym[0] |
33 | 32 | ym = ym[1:] |
34 | 33 | #print(ym) |
35 | | - concore2.write(concore.oport['Y'],"ym",ym) |
36 | | - print("funcall 0mq u="+str(u)+" ym="+str(ym)+" time="+str(concore2.simtime)) |
| 34 | + concore.write(concore.oport['Y'],"ym",ym) |
| 35 | + print("funcall 0mq u="+str(u)+" ym="+str(ym)+" time="+str(concore.simtime)) |
37 | 36 | finally: |
38 | 37 | paired_transmitter.stop_background_sync() |
39 | 38 | print("retry="+str(concore.retrycount)) |
0 commit comments