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

allow device to be put in read-only mode via the GUI #414

Merged
merged 3 commits into from
Sep 30, 2019

Conversation

LilithCole
Copy link
Contributor

@LilithCole LilithCole commented Aug 22, 2019

Description of work

Can now set the access security group for all output records to read-only, via a macro.

Ticket

DETMON: Read only option for the HVCAEN IOC #4184

Acceptance criteria

The IOC can be set to read-only mode via the "IFREADONLY" macro, but is not in read-only mode by default.


Code Review

Functional Tests

  • IOC responds correctly in:
    • Devsim mode
    • Recsim mode
    • Real device, if available
  • Supplementary IOCs (..._0n where n>1) run correctly
  • Log files do not report undefined macros (serach for macLib: macro to find instances of macLib: macro [macro name] is undefined...

Final steps

  • Update the IOC submodule in the main EPICS repo. See Git workflow page for details.
  • Reviewer has moved the release notes entry for this ticket in the "Changes merged into master" section

@@ -27,7 +29,8 @@ CAENx527ConfigureCreate "hv0", "127.0.0.1"

## Load our record instances
#dbLoadRecords("db/xxx.db","user=faa59Host")
CAENx527DbLoadRecords("P=$(MYPVPREFIX)CAEN, ALARM_WHEN_ON=$(ALARM_WHEN_ON=NO_ALARM), ALARM_WHEN_RAMPING=$(ALARM_WHEN_RAMPING=NO_ALARM)")
$(CAN_WRITE= ) CAENx527DbLoadRecords("P=$(MYPVPREFIX)CAEN, ALARM_WHEN_ON=$(ALARM_WHEN_ON=NO_ALARM), ALARM_WHEN_RAMPING=$(ALARM_WHEN_RAMPING=NO_ALARM), ASG=READONLY")
$(IFREADONLY= ) CAENx527DbLoadRecords("P=$(MYPVPREFIX)CAEN, ALARM_WHEN_ON=$(ALARM_WHEN_ON=NO_ALARM), ALARM_WHEN_RAMPING=$(ALARM_WHEN_RAMPING=NO_ALARM), ASG=DEFAULT")
Copy link
Contributor

Choose a reason for hiding this comment

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

Using this approach we have to duplicate lines in a number of places, this makes the code harder to change in future. How about just passing down the ASG directly from the config (restricted to just READONLY and DEFAULT by the pattern)? This way we don't need to worry about any extra code. I also thing READONLY/DEFAULT are clearer options for a user than #/ (even with an explanation).

<macros>
<macro name ="IFREADONLY" pattern="^ |#$" description="Whether device is readonly. Set to # for readonly, default is ' ' (just spacebar), for read and write" />
</macros>
</config_part>
Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't a very user-friendly macro to set, even with the additional description/explanation. As per comment below maybe just pass the ASG directly here as DEFAULT/READONLY as this is clearer.

@LilithCole
Copy link
Contributor Author

@KathrynBaker would the changes suggested here be acceptable?

@Tom-Willemsen Tom-Willemsen merged commit 2232fe7 into master Sep 30, 2019
@Tom-Willemsen Tom-Willemsen deleted the Ticket4184_DETMON_read_only_HVCAEN_IOC branch September 30, 2019 12:54
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