Skip to content

Commit

Permalink
added iocs/eps_two_state_ioc_sim.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalitsky committed Apr 28, 2019
1 parent cde291a commit d7396df
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions nslsii/iocs/eps_two_state_ioc_sim.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,29 +88,25 @@ def __init__(self, retries=2, enbl_sts_val='True',

@enbl_sts.startup
async def enbl_sts(self, instance, async_lib):
print('in enbl_sts', 'enbl_sts_val:', self._enbl_sts_val)
await instance.write(value=self._enbl_sts_val)

@state1_cmd.putter
async def state1_cmd(self, instance, value):
rv = await self._state_cmd_put(instance, value,
self._pos_states[0],
self.fail_to_state1)
print('in state1_cmd', 'value:', value, 'rv:', rv)
return rv

@state2_cmd.putter
async def state2_cmd(self, instance, value):
rv = await self._state_cmd_put(instance, value,
self._pos_states[1],
self.fail_to_state2)
print('in state2_cmd', 'value:', value, 'rv:', rv)
return rv

# Internal Methods

async def _state_cmd_put(self, instance, value, state_val, fail_to_state):
print('1. state_cmd_put:', 'value:', value, 'state_val:', state_val)
if(value == self._cmd_states[0]): # if None -> do nothing
return self._cmd_states[0]
if(self._pos_sts_val == state_val): # if in state -> do nothing
Expand All @@ -130,7 +126,6 @@ async def _state_cmd_put(self, instance, value, state_val, fail_to_state):
return self._cmd_states[1]
await self.pos_sts.write(value=state_val)
self._pos_sts_val = state_val
print('pos_sts.write:', state_val)
return self._cmd_states[0]


Expand All @@ -157,8 +152,6 @@ async def _state_cmd_put(self, instance, value, state_val, fail_to_state):
args = parser.parse_args()
ioc_options, run_options = split_args(args)

print(ioc_options, args.retries, args.enable, args.hwerror, args.stserror)

ioc = EPSTwoStateIOC(retries=args.retries,
enbl_sts_val=args.enable,
hw_error_val=args.hwerror,
Expand Down

0 comments on commit d7396df

Please sign in to comment.