Closed jesusvasquez333 closed 4 years ago
@jesusvasquez333 to get the version with the new epics registers (e.g. ConfiguringInProgress
and SystemConfigured
) do I just update the release scripts and checkout a new v4.0.0 dev_fw? Or do I need to run with a dev_sw version?
We should make sure the solution to this issue is backwards compatible ; suggest polling at the start for one of the new PVs and if that times out, configuring the way we currently do (by just hitting setDefaults).
@swh76 these changes are not in a tagged release yet, so we will need to use a software development
mode to test it.
Regarding backward compatible: An alternative is to read the pysmurf version available in the register SmurfApplication.SmurfVersion. Of course, this will work only once we do a new release. For example let's say v4.1.0
is the new version, then:
SmurfApplication.SmurfVersion
< 4.1.0
, then configure they way you do it now,SmurfApplication.SmurfVersion
>= 4.1.0
, then configure using the new methodGot it, thanks.
@jesusvasquez333 @ruck314 Mostly implemented in branch issue462
, but ran into a small issue ; I see approx. a 5sec lab between when ConfiguringInProgress
clears and when SystemConfigured
returns True
. I'll add a wait for now but might want to have ConfiguringInProgress only -> False after SystemConfigured is updated, if possible.
@jesusvasquez333 @ruck314 Also, should setting setDefaults=1 clear the SystemConfigured flag?
@swh76 I will take a look. That delay is not expected
@swh76 I did a quick test using camonitor
from bash, and it looks correct:
cryo@smurf-srv19:/$ camonitor smurf_server_s2:AMCc:SmurfApplication:SystemConfigured smurf_server_s2:AMCc:SmurfApplication:ConfiguringInProgress
smurf_server_s2:AMCc:SmurfApplication:SystemConfigured 2020-07-21 20:10:08.566601 True
smurf_server_s2:AMCc:SmurfApplication:ConfiguringInProgress 2020-07-21 20:10:08.567282 False
smurf_server_s2:AMCc:SmurfApplication:SystemConfigured 2020-07-21 20:10:08.567081 True
smurf_server_s2:AMCc:SmurfApplication:ConfiguringInProgress 2020-07-21 20:10:08.570074 False
<<<< called setDefaults here >>>
smurf_server_s2:AMCc:SmurfApplication:SystemConfigured 2020-07-21 20:10:43.568072 *** disconnected
smurf_server_s2:AMCc:SmurfApplication:ConfiguringInProgress 2020-07-21 20:10:43.568120 *** disconnected
CA.Client.Exception...............................................
Warning: "Virtual circuit unresponsive"
Context: "smurf-srv19.slac.stanford.edu:38401"
Source File: ../tcpiiu.cpp line 920
Current Time: Tue Jul 21 2020 20:10:43.568040572
..................................................................
smurf_server_s2:AMCc:SmurfApplication:SystemConfigured 2020-07-21 20:10:56.834265 True
smurf_server_s2:AMCc:SmurfApplication:ConfiguringInProgress 2020-07-21 20:10:56.834317 False
smurf_server_s2:AMCc:SmurfApplication:ConfiguringInProgress 2020-07-21 20:10:56.902352 False
smurf_server_s2:AMCc:SmurfApplication:SystemConfigured 2020-07-21 20:10:56.902432 True
smurf_server_s2:AMCc:SmurfApplication:SystemConfigured 2020-07-21 20:10:57.221892 True
smurf_server_s2:AMCc:SmurfApplication:ConfiguringInProgress 2020-07-21 20:10:57.221961 False
When I call the setDefaults command, the server becomes unresponsive and the PVs get disconnected. But the process finished, both SystemConfigured
and ConfiguringInProgress
are et almost at the same time.
And this is what I see when running the script I added in the description of this issue:
cryo@smurf-srv19:/$ /shared/test.py
Setting defaults...
CA.Client.Exception...............................................
Warning: "Virtual circuit unresponsive"
Context: "smurf-srv19.slac.stanford.edu:38401"
Source File: ../tcpiiu.cpp line 920
Current Time: Tue Jul 21 2020 20:22:30.125183348
..................................................................
System configuration finished after 42 seconds. The final state was True
So, I don't see the delay you mentioned.
@swh76 and yes, calling setDefaults
clear SystemConfigured
.
This what happens when setDefaults
is called, as defined here:
ConfiguringInProgress
= True
SystemConfigured
= False
SystemConfigured
= either True
or False
depending on the result of the last 2 steps,ConfiguringInProgress
= False
Ah great re: calling setDefaults clear SystemConfigured. I think I just got fooled because the gui doesn't always update during the setDefaults call. Thanks!
Describe the problem
In recent PRs (#459 and #461) I added two new registers to the tree, under the
SmurfApplication
device. These register give information about the state of the configuration process which is trigger when calling thesetDefaults
command. These new register are:ConfiguringInProgress
: boolean flag that indicates if the configuration process is in progress. It is set toTrue
when thesetDefaults
command is called, and then it is set toFalse
when the method exits.SystemConfigured
: boolean flag that indicates the final state of the configuration process. If the configuration was loaded without errors and all the test passed, then this flag is set toTrue
when the method exits.So, I propose to use this new registers in the set_defaults_pv method, instead of the current way of calling the method and then wait.
Describe the solution you'd like
An example on how these variables can be used, could be something like this:
Then other functions calling this method should use its return value to determine is the system was configured correctly. Subsequent function calls shouldn't continue of this one fails.