Skip to content
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

Smart loops control offset #77

Merged
merged 8 commits into from
Apr 12, 2024

Conversation

framos-gemini
Copy link
Collaborator

This version of GMP has two improvements:

  1. When it receives the offset command, the control loops are opened and closed depending on the (SOS) configuration.
  2. It is more robust to client failures. For example, if the GMP receives a COMPLETED response, and then the STARTED response of a specific sequence command, it now handles this exception correctly without causing failures in the ActiveMQ protocol.

It also has the latest keyword configuration updated.

@cquiroz
Copy link
Contributor

cquiroz commented Apr 9, 2024

Sorry to bother but could we split this into two PRs
One for the the client failures fix and another for offsets.
In particular because the firrst may need to be applied to the other branches

@@ -69,7 +100,7 @@ public class EpicsTcsOffsetIOC implements TcsOffsetIOC {
/**
* HashMap used to store the open and close loops sequence actions.
*/
private HashMap<String, ReadWriteClientEpicsChannel<String>> _chLoops = new HashMap<>();
private HashMap<String, ChannelAccess> _caLoops = new HashMap<>();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change, If I understand correctly here we have a map of names to channel but it seems this is now a map of names to the global channel access? or is ChannelAccess specific to one channel?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now it is implemented in the ChannelAccess (link) class and their derivated class. This one was necessary because I changed the structure of the json configuration file. Another important aspect of this json is that now the sequence defines what it depends on in order to open or close the loop. For example, if the operator is using P2, this value has to be true in the TCS. Therefore, the sequence will check this CA, and if the specified value is met, the integration will stop. All commands that were executed (in the "open loop sequence") are checked and in the "closed loop sequence" only those that were previously checked will be activated. Therefore, only the loops configured by the SOS will be actuated.

public boolean check(JsonElement val) {
try {
return val.getAsShort() == _epicsChannel.getFirst();
} catch (CAException | TimeoutException e) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting, I haven't seen those early, this must be a newer java feature

@@ -1,7 +1,8 @@
# Contains the description of the properties that can be obtained through the
# GIAPI. Each property has a string value associated.

GMP_HOST_NAME = localhost
#GMP_HOST_NAME = localhost
GMP_HOST_NAME = 172.18.13.80
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the one we use for local development,, do we want it to point to IG2?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, good point. I am going to change it. Thanks!!!

Copy link
Contributor

@cquiroz cquiroz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
Thanks some small comments inline

@framos-gemini
Copy link
Collaborator Author

thank you Carlos for reviewing the PR.

@cquiroz cquiroz merged commit 785b984 into gemini-hlsw:main Apr 12, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants