-
Notifications
You must be signed in to change notification settings - Fork 32
fix: replace concore2 imports with concore (resolves #287) #306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
490a619
ba08829
79a7e31
5ebcfc0
1559a30
0563c1c
ab214a0
d34f485
b1d1d23
6c0fce9
fa1aa26
36a0c9e
efee0e8
33820fd
6847bc1
d682891
ab956e0
b6f87cd
3e6c958
aaebd5d
9b886d0
bda776f
e980a81
4f1382f
f8869e9
58915e3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,25 +1,24 @@ | ||
| import concore | ||
| import concore2 | ||
|
|
||
| concore.delay = 0.07 | ||
| concore2.delay = 0.07 | ||
| concore2.inpath = concore.inpath | ||
| concore2.outpath = concore.outpath | ||
| concore2.simtime = 0 | ||
| concore.delay = 0.07 | ||
| concore.inpath = concore.inpath | ||
| concore.outpath = concore.outpath | ||
|
GaneshPatil7517 marked this conversation as resolved.
Outdated
|
||
| concore.simtime = 0 | ||
| concore.default_maxtime(100) | ||
| init_simtime_u = "[0.0, 0.0, 0.0]" | ||
| init_simtime_ym = "[0.0, 0.0, 0.0]" | ||
|
|
||
| u = concore.initval(init_simtime_u) | ||
| ym = concore2.initval(init_simtime_ym) | ||
| while(concore2.simtime<concore.maxtime): | ||
| ym = concore.initval(init_simtime_ym) | ||
| while(concore.simtime<concore.maxtime): | ||
| while concore.unchanged(): | ||
| u = concore.read(concore.iport['U'],"u",init_simtime_u) | ||
| concore.write(concore.oport['U1'],"u",u) | ||
| print(u) | ||
| old2 = concore2.simtime | ||
| while concore2.unchanged() or concore2.simtime <= old2: | ||
| ym = concore2.read(concore.iport['Y1'],"ym",init_simtime_ym) | ||
| concore2.write(concore.oport['Y'],"ym",ym) | ||
| print("funbody u="+str(u)+" ym="+str(ym)+" time="+str(concore2.simtime)) | ||
| old2 = concore.simtime | ||
|
GaneshPatil7517 marked this conversation as resolved.
Outdated
|
||
| while concore.unchanged() or concore.simtime <= old2: | ||
| ym = concore.read(concore.iport['Y1'],"ym",init_simtime_ym) | ||
| concore.write(concore.oport['Y'],"ym",ym) | ||
| print("funbody u="+str(u)+" ym="+str(ym)+" time="+str(concore.simtime)) | ||
| print("retry="+str(concore.retrycount)) | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,4 @@ | ||
| import concore | ||
| import concore2 | ||
| import time | ||
| from osparc_control import CommandManifest | ||
| from osparc_control import CommandParameter | ||
|
|
@@ -27,17 +26,17 @@ | |
| paired_transmitter.start_background_sync() | ||
|
|
||
| concore.delay = 0.07 | ||
| concore2.delay = 0.07 | ||
| concore2.inpath = concore.inpath | ||
| concore2.outpath = concore.outpath | ||
| concore2.simtime = 0 | ||
| concore.delay = 0.07 | ||
|
GaneshPatil7517 marked this conversation as resolved.
|
||
| concore.inpath = concore.inpath | ||
| concore.outpath = concore.outpath | ||
|
GaneshPatil7517 marked this conversation as resolved.
Outdated
|
||
| concore.simtime = 0 | ||
| concore.default_maxtime(100) | ||
| init_simtime_u = "[0.0, 0.0, 0.0]" | ||
| init_simtime_ym = "[0.0, 0.0, 0.0]" | ||
|
|
||
| u = concore.initval(init_simtime_u) | ||
| ym = concore2.initval(init_simtime_ym) | ||
| while(concore2.simtime<concore.maxtime): | ||
| ym = concore.initval(init_simtime_ym) | ||
| while(concore.simtime<concore.maxtime): | ||
| #while concore.unchanged(): | ||
| # u = concore.read(concore.iport['U1'],"u",init_simtime_u) | ||
| command_list = paired_transmitter.get_incoming_requests() | ||
|
|
@@ -53,17 +52,17 @@ | |
| u = u[1:] | ||
| concore.write(concore.oport['U2'],"u",u) | ||
| print(u) | ||
| old2 = concore2.simtime | ||
| while concore2.unchanged() or concore2.simtime <= old2: | ||
| ym = concore2.read(concore.iport['Y2'],"ym",init_simtime_ym) | ||
| ym = [concore2.simtime]+ym | ||
| old2 = concore.simtime | ||
| while concore.unchanged() or concore.simtime <= old2: | ||
| ym = concore.read(concore.iport['Y2'],"ym",init_simtime_ym) | ||
|
||
| ym = [concore.simtime]+ym | ||
| print(f"Replying to {command.action} with {ym}") | ||
| paired_transmitter.reply_to_command( | ||
| request_id=command.request_id, payload=ym) | ||
| else: | ||
| print("undefined action"+str(command.action)) | ||
| quit() | ||
| #concore2.write(concore.oport['Y1'],"ym",ym) | ||
| print("funbody u="+str(u)+" ym="+str(ym)+" time="+str(concore2.simtime)) | ||
| #concore.write(concore.oport['Y1'],"ym",ym) | ||
| print("funbody u="+str(u)+" ym="+str(ym)+" time="+str(concore.simtime)) | ||
| paired_transmitter.stop_background_sync() | ||
| print("retry="+str(concore.retrycount)) | ||
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,5 +1,4 @@ | ||||
| import concore | ||||
| import concore2 | ||||
| import time | ||||
| from osparc_control import CommandManifest | ||||
| from osparc_control import CommandParameter | ||||
|
|
@@ -27,17 +26,17 @@ | |||
| paired_transmitter.start_background_sync() | ||||
|
|
||||
| concore.delay = 0.07 | ||||
| concore2.delay = 0.07 | ||||
| concore2.inpath = concore.inpath | ||||
| concore2.outpath = concore.outpath | ||||
| concore2.simtime = 0 | ||||
| concore.delay = 0.07 | ||||
|
||||
| concore.delay = 0.07 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,7 +1,6 @@ | ||||||
| # funbody2_zmq.py | ||||||
| import time | ||||||
| import concore | ||||||
| import concore2 | ||||||
|
|
||||||
| print("funbody using ZMQ via concore") | ||||||
|
|
||||||
|
|
@@ -16,21 +15,21 @@ | |||||
|
|
||||||
| # Standard concore initializations | ||||||
| concore.delay = 0.07 | ||||||
| concore2.delay = 0.07 | ||||||
| concore2.inpath = concore.inpath | ||||||
| concore2.outpath = concore.outpath | ||||||
| concore2.simtime = 0 | ||||||
| concore.delay = 0.07 | ||||||
|
||||||
| concore.delay = 0.07 |
Copilot
AI
Feb 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Potential logic issue: This code pattern may create an infinite loop. The variable old_concore_simtime now references the same concore.simtime that is checked in the loop condition, whereas the original code tracked two separate simulation times.
| while concore.unchanged() or concore.simtime <= old_concore_simtime: | |
| while concore.unchanged() and concore.simtime <= old_concore_simtime: |
| Original file line number | Diff line number | Diff line change | ||
|---|---|---|---|---|
| @@ -1,7 +1,6 @@ | ||||
| # funbody2_zmq.py | ||||
| import time | ||||
| import concore | ||||
| import concore2 | ||||
|
|
||||
| print("funbody using ZMQ via concore") | ||||
|
|
||||
|
|
@@ -15,21 +14,21 @@ | |||
|
|
||||
| # Standard concore initializations | ||||
| concore.delay = 0.07 | ||||
| concore2.delay = 0.07 | ||||
| concore2.inpath = concore.inpath | ||||
| concore2.outpath = concore.outpath | ||||
| concore2.simtime = 0 | ||||
| concore.delay = 0.07 | ||||
|
||||
| concore.delay = 0.07 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,6 @@ | ||
| # funbody2_zmq.py | ||
| import time | ||
| import concore | ||
| import concore2 | ||
|
|
||
| print("funbody using ZMQ via concore") | ||
|
|
||
|
|
@@ -15,21 +14,21 @@ | |
|
|
||
| # Standard concore initializations | ||
| concore.delay = 0.07 | ||
| concore2.delay = 0.07 | ||
| concore2.inpath = concore.inpath | ||
| concore2.outpath = concore.outpath | ||
| concore2.simtime = 0 | ||
| concore.delay = 0.07 | ||
|
GaneshPatil7517 marked this conversation as resolved.
Outdated
|
||
| concore.inpath = concore.inpath | ||
| concore.outpath = concore.outpath | ||
|
||
| concore.simtime = 0 | ||
| concore.default_maxtime(100) | ||
| init_simtime_u_str = "[0.0, 0.0, 0.0]" | ||
| init_simtime_ym_str = "[0.0, 0.0, 0.0]" | ||
|
|
||
| u_data_values = concore.initval(init_simtime_u_str) | ||
| ym_data_values = concore2.initval(init_simtime_ym_str) | ||
| ym_data_values = concore.initval(init_simtime_ym_str) | ||
|
|
||
| print(f"Initial u_data_values: {u_data_values}, ym_data_values: {ym_data_values}") | ||
| print(f"Max time: {concore.maxtime}") | ||
|
|
||
| while concore2.simtime < concore.maxtime: | ||
| while concore.simtime < concore.maxtime: | ||
| received_u_data = concore.read(PORT_NAME_F2_OUT, "u_signal", init_simtime_u_str) | ||
|
|
||
| if not (isinstance(received_u_data, list) and len(received_u_data) > 0): | ||
|
|
@@ -49,17 +48,17 @@ | |
| if 'U2' in concore.oport: | ||
| concore.write(concore.oport['U2'], "u", u_data_values) | ||
|
|
||
| old_concore2_simtime = concore2.simtime | ||
| while concore2.unchanged() or concore2.simtime <= old_concore2_simtime: | ||
| old_concore_simtime = concore.simtime | ||
| while concore.unchanged() or concore.simtime <= old_concore_simtime: | ||
| # Assuming concore.iport['Y2'] is a file port (e.g., from pmpymax.py) | ||
| ym_data_values = concore2.read(concore.iport['Y2'], "ym", init_simtime_ym_str) | ||
| # time.sleep(concore2.delay) # Optional delay | ||
| ym_data_values = concore.read(concore.iport['Y2'], "ym", init_simtime_ym_str) | ||
|
GaneshPatil7517 marked this conversation as resolved.
Outdated
|
||
| # time.sleep(concore.delay) # Optional delay | ||
|
|
||
| ym_full_to_send = [concore2.simtime] + ym_data_values | ||
| ym_full_to_send = [concore.simtime] + ym_data_values | ||
|
|
||
| concore.write(PORT_NAME_F2_OUT, "ym_signal", ym_full_to_send) | ||
|
|
||
| print(f"funbody u={u_data_values} ym={ym_data_values} time={concore2.simtime}") | ||
| print(f"funbody u={u_data_values} ym={ym_data_values} time={concore.simtime}") | ||
|
|
||
| print("funbody retry=" + str(concore.retrycount)) | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,39 +1,38 @@ | ||||||
| import concore | ||||||
| import concore2 | ||||||
| from osparc_control import PairedTransmitter | ||||||
| print("funcall 0mq") | ||||||
|
|
||||||
| concore.delay = 0.07 | ||||||
| concore2.delay = 0.07 | ||||||
| concore2.inpath = concore.inpath | ||||||
| concore2.outpath = concore.outpath | ||||||
| concore2.simtime = 0 | ||||||
| concore.delay = 0.07 | ||||||
|
||||||
| concore.delay = 0.07 |
Copilot
AI
Feb 14, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Self-assignment statements (lines 7-8) are redundant no-ops that should be removed.
| concore.inpath = concore.inpath | |
| concore.outpath = concore.outpath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Duplicate assignment of concore.delay. Line 4 is redundant and should be removed.