Project

General

Profile

How to know if we are in acquisition ?

Added by Legay, Eric about 9 years ago

We need to check if we are in a run or not ?

For me a run begins when clicking on play and stop at the end or when clicking on stop.

Is it a property or a method to know it ?


Replies (7)

RE: How to know if we are in acquisition ? - Added by Locatelli, Jerome about 9 years ago

What to you mean exactly? To see on the screen if is it running? Or in the software?

RE: How to know if we are in acquisition ? - Added by Legay, Eric about 9 years ago

In a driver, I would like to have two kinds of actions depending of acquisition status.

RE: How to know if we are in acquisition ? - Added by Locatelli, Jerome about 9 years ago

It possible to do that if the status you read and the action you want to do are in the same driver.

Otherwise, you have to do that in high level (in controller) which is linked with the acquisition for reading the status, and linked to the (driver or controller) for doing the action).

It is impossible to link driver together otherwise they have a parent link.

RE: How to know if we are in acquisition ? - Added by Legay, Eric about 9 years ago

I'm working on orsay / NomadServer / trunk / src / ics / DeviceContainer / Drivers / Marconi / MI2019A.

Technically, can I know when I click on play (or start, what is the right terminology ?) ?

If I'm right, when clicking on start, we call the start method from my driver. So we could add a parameter inside the driver object to know if start is on.
But, the stop method is called only when clicking on stop button ?

Is it right ?

RE: How to know if we are in acquisition ? - Added by Locatelli, Jerome about 9 years ago

Yes, it is right.

You can also set the PROGRESSION property to 100% inside your driver during reading status or other. That will finished the action without clicking stop button.

Technically, can I know when I click on play (or start, what is the right terminology ?) -> we use as you said an local variable generally called m_StartActivated. But, there is no global thing for all drivers. Drivers could have many commands, not only start.

RE: How to know if we are in acquisition ? - Added by Legay, Eric almost 9 years ago

We had some problems ...

In the driver we used, NOMAD calls only start and off method.
We were unable to find a way to call stop and on method. Some details are missing us.

We cheat, and now on the beginning the radio frequency output is on and we turn it off at the end.
But we used the frequency value, tio turn off the output. If the frequency value is out of the right frequency range, we turn off the output.

So physicist have only to add a frequency box at the end of the script with a value out of bound.

Maybe, it will be great to talk about this next time. I would like to understand how we could do it in a cleaner way :)

RE: How to know if we are in acquisition ? - Added by Mutti, Paolo almost 9 years ago

You should implement a property in the frequency controller (not the driver!). In the interface you will have a checkbox ON-OFF and when you want to put the generator off at the end of the script you just add a box with the checkbox OFF validated. It is then the method start which will make the difference in case OFF is activated. If you want to have an example of this implementation you can have a look at currentController.cpp.

Do not hesitate to call if I was not clear.

    (1-7/7)