forked from coderdj/redax
-
Notifications
You must be signed in to change notification settings - Fork 7
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
Redefinition of Physical and Logical detectors #100
Open
valerioda
wants to merge
10
commits into
master
Choose a base branch
from
dispatcher_phys_oct22
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mflierm
reviewed
Nov 24, 2022
@@ -763,35 +784,35 @@ def get_run_start(self, number): | |||
return self.run_start_cache[str(number)] | |||
return None | |||
|
|||
def insert_run_doc(self, detector): | |||
def insert_run_doc(self, logical): | |||
|
|||
if (number := self.get_next_run_number()) == NO_NEW_RUN: | |||
self.logger.error("DB having a moment") | |||
return -1 | |||
# the rundoc gets the physical detectors, not the logical | |||
detectors = self.latest_status[detector]['detectors'] |
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.
I think it's going to complain in this line about detector
. Should it be logical
?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The dispatcher get
goal_state
fromMongoConnect.get_wanted_state
where there is a loop on physical detectors and thelatest_status
fromMongoConnecy.get_update
using the current configuration that is coming from MongoConnect.get_super_detector. Then it loops among thelatest_status.keys
and checks the goal status, the variable detector is used for both physical and logical detectors, the main goal of the performed changes is to avoid this and have a more clear and separate definition of the two chategories of detectors.Main changes are listed:
in
MongoConnect.py
the logical detector is created with the functionget_logical_detector
(formerget_super_detector
) with five possible linking cases that are addressed separately with logical statements, in this way is possible to have proper name for the logical detector (e.g., in case of all physical detectors linked isall_linked
instead oftpc
). The five cases:in
dispatcher.py
added new loop: 1st loop on logical detectors usinglatest_status.keys
, 2nd loop on physical detectors usinglatest_status[log_det]['detectors'].keys
, the printed status then reports the aggregate status for both logical and physical detectorsin
DAQController.py
the input detector explicity calledlogical
, in particular incontrol_detector
andcheck_timeouts
; the first physical detector is used as representative of the logical detector, needed to take goal mode and status and count the missed arm cycles and error stops (also functionshandle_timeout
,stop_detector_gently
andcheck_run_turnover
has been changed in order to use both logical and physical detectors); also inMongoConnect.py
modifiedinsert_run_doc
and andset_stop_time
in
hypervisor.py
changes inlinked_nuclear_option
: modified loop to check for the status of physical detectors, added debug messages, added check of all hosts (readers and controllers) to see if they are responding, calculated again the aggregate status of the physical detectors and compared with the one fromMongoConnect.aggregate_status
, if the two status are not matching or the detector is in[ERROR, TIMETOUT, UNKNOWN
] the detector is included intimeout_list
otherwise inrunning_list