[INSTRM-109] Retrieve status of individual command when using a sequencer Created: 27/Apr/17  Updated: 12/Jun/18  Resolved: 18/Oct/17

Status: Done
Project: Instrument control development
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: arnaud.lefur Assignee: cloomis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Sprint: 2017-10A
Reviewers: cloomis

 Description   

ics_spsaitActor has for now a very basic operating logic.
Basically, a sequence is only a list of single command.
For each of it, we are using actorcore.cmdr.call function where we are passing a keyvar with few arguments :

  • actor
  • cmdStr
  • timeLim
  • forUserCmd

When the command is over, or overpass timeLim, we switch to next command etc ...

The problem is that we don't know if the command has finished correctly or not.
We can check actors keywords in some cases.
for instance if we call a ccd wipe, we know that ccdState should be integrating
But that's not working in every cases.

I did investigate a bit, in the keyvar documentation, and it seems that there is a way to pass a callback :

callFunc: a function to call when the command changes state; see addCallback for details.

In the case of actorcore.cmdr.call this callFunc is overridden, so I can't use it:

q = Queue.Queue()
argv['callFunc'] = q.put

I was wondering if it's something already used in the past, I may miss something.

Thank you.



 Comments   
Comment by cloomis [ 28/Apr/17 ]

`actorcore.cmdr.call` returns an object which has a `didFail` member. Umm:

        cmdVar = self.actor.cmdr.call(actor='mcs', cmdStr=cmdString,
                                       forUserCmd=cmd, timeLim=expTime+5.0)
        if cmdVar.didFail:
            cmd.fail('text=%s' % (qstr('Failed to expose with %s' % (cmdString))))
            return

I confess that I do not know all the things to be found in those objects, but that is one of them.

Comment by shimono [ 28/Apr/17 ]

cloomis do you have complete document pointer for them, both retuning reply to command and handling at caller?

Comment by arnaud.lefur [ 28/Apr/17 ]

Thank you ! How could I miss that ...
Also cmdVar has a lastReply member which contain the full status of the command.
It's all I need for now.

Comment by arnaud.lefur [ 18/Oct/17 ]
cmdVar.lastReply.canonical()

This function return a string compose of 5 members separated by space:

  1. client_id.sequencer_id (client.alefur.spsait_sm1)
  2. cmd_id (972)
  3. actor name (xcu_r1)
  4. cmd status ( F for failed, : for finished)
  5. keyword (text="communication with turbo has failed")

All information needed is here,
but it's up to the programmer to forward this to the client.

Comment by cloomis [ 18/Oct/17 ]

I'm not sure what you mean by "it's up to the programmer to forward this to the client." If the caller of spsait cares, it can get it by itself. If something is broken, the alertsActor will see it. If spsait sometimes cares and sometimes doesn't, it has the information it needs. If spsait is responsible for declaring parts up/down, then it can. But I don't think anything should simply "forward" another actor's keys.

Comment by arnaud.lefur [ 19/Oct/17 ]

Hmm, I should have said "it's up to the programmer to forward or not this information to the client."
In spsaitActor if a command fail during a sequence, I've had a optional keyword doRetry which gives a sequencer another to complete its sequence.
That's convenient for AIT, because bugs occurs for time to time and I think that's okay for non critical device.

But if in the end a sequence fail, I like directly to know what went wrong and why, and if it's not sufficient I can check the logs of course.
We still don't have an actual failure handling for now, so I'm shortcutting it.

But you're right, that's not ideal.

Generated at Sat Feb 10 16:21:38 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.