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

Add "HRC not run" event to handle HRC being disabled #309

Merged
merged 4 commits into from
Dec 29, 2023
Merged

Conversation

taldcroft
Copy link
Member

@taldcroft taldcroft commented Dec 25, 2023

Description

This PR provides a better way to handle HRC being disabled than adding a bunch of Command not run events. It follows the pattern from Load not run and Observing not run.

I have added this new event type to the FOT MP documentation page just to get it done with now. There is no danger of this accidentally getting into the flight Events Sheet.

Interface impacts

Supports new HRC not run entry on Events Sheet.

Testing

Unit tests

  • Mac (new unit test)
➜  kadi git:(hrc-disable) git rev-parse HEAD                                                        
8158e773d3a87499373378d17a5e414fd669b46d
➜  kadi git:(hrc-disable) pytest
===================================================== test session starts ======================================================
platform darwin -- Python 3.10.8, pytest-7.2.1, pluggy-1.0.0
rootdir: /Users/aldcroft/git, configfile: pytest.ini
plugins: timeout-2.1.0, anyio-3.6.2
collected 221 items                                                                                                            

kadi/commands/tests/test_commands.py .............................................................................       [ 34%]
kadi/commands/tests/test_states.py ......................x.............................................x................ [ 73%]
.......                                                                                                                  [ 76%]
kadi/commands/tests/test_validate.py ....................                                                                [ 85%]
kadi/tests/test_events.py ..........                                                                                     [ 90%]
kadi/tests/test_occweb.py ......................                                                                         [100%]

========================================== 219 passed, 2 xfailed in 141.11s (0:02:21) ==========================================

Independent check of unit tests by Jean

  • Linux

Functional tests

No functional testing.

@jeanconn
Copy link
Contributor

As a reviewer on this I'm working just from the kadi states understanding of how HRC is commanded. So from that perspective -- is there a name for the nominal operation of HRC via these SCS activations as compared to the hardware commands? This ends up just being a documentation question really.

@taldcroft
Copy link
Member Author

is there a name for the nominal operation of HRC via these SCS activations

I'm not aware of a good and descriptive name, but they fall within the "HRC return to science operations concept" (along with a hundred other things).

@jeanconn
Copy link
Contributor

OK. Sounds fine as long as it will be clear to the users here that the HRC not run is only going to apply to this nominal operations concept and not to any hardware commands.

cmds_dir = Path(commands_v2.conf.commands_dir) / scenario
cmds_dir.mkdir(exist_ok=True, parents=True)
# Note variation in format of date, since this comes from humans.
cmd_evts_text = """\
Copy link
Contributor

Choose a reason for hiding this comment

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

This test would probably be stronger if the states were evaluated with and without the hrc not run -- but as a sanity and regress test this is good.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good idea, I'll fix this.

@taldcroft
Copy link
Member Author

Sounds fine as long as it will be clear to the users here that the HRC not run is only going to apply to this nominal operations concept and not to any hardware commands.

In fact the hardware commands do actually run on board, they just don't do anything because the instrument is off.

But yes, there is a bit of duct tape in all this. F_HRC_SAFING disables SCSs 92, 93 and 134, but the kadi state values depend on 89, 90, and 134 due to the way HRC is run. So this PR ignores 89, 90 instead of 92, 93, because that is what makes things work.

@taldcroft
Copy link
Member Author

Thinking more, F_HRC_SAFING can be run in the middle of an HRC observation and it turns off HRC immediately. So I need to insert some commands at the event date to do that.

@jeanconn
Copy link
Contributor

"In fact the hardware commands do actually run on board, they just don't do anything because the instrument is off."

Right, I meant hardware commands in the loads, as those are the ones that are defined as state-changing-things in kadi.

@jeanconn
Copy link
Contributor

"So I need to insert some commands at the event date to do that."

Sounds good to take the time to do that update to this PR to future-proof it.

@taldcroft
Copy link
Member Author

taldcroft commented Dec 28, 2023

I meant hardware commands in the loads, as those are the ones that are defined as state-changing-things in kadi.

OK now I get your drift. There are dozens of HRC hardware commands in the loads. But you were referring to just the two state-changing ones that control the 15V and 24V. The 15V is never commanded in the loads in the Return to science concept and (if it was included) there would be no way to stop it from running besides running SCS-107.

But the 24V hardware command is in the loads and it becomes a no-op when the 15V is off. This is reflected in 1e46442.

@taldcroft
Copy link
Member Author

@jeanconn - thanks for the comments, this PR is definitely better now and hopefully ready!

@taldcroft taldcroft merged commit 13267aa into master Dec 29, 2023
4 checks passed
@taldcroft taldcroft deleted the hrc-disable branch December 30, 2023 00:02
@javierggt javierggt mentioned this pull request Jan 11, 2024
@javierggt javierggt mentioned this pull request Feb 6, 2024
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