Commit 64fbeb9e authored by Vincent Michel's avatar Vincent Michel

Add get_detectors to interface

parent 0ab803ff
......@@ -20,11 +20,22 @@ def new_detector(alias):
return handel.xiaNewDetector(alias)
#int xiaAddDetectorItem(char *alias, char *name, void *value);
#int xiaModifyDetectorItem(char *alias, char *name, void *value);
#int xiaGetDetectorItem(char *alias, char *name, void *value);
# int xiaAddDetectorItem(char *alias, char *name, void *value);
# int xiaModifyDetectorItem(char *alias, char *name, void *value);
# int xiaGetDetectorItem(char *alias, char *name, void *value);
def get_num_detectors():
num = ffi.new('unsigned int *')
check_error(handel.xiaGetNumDetectors(num))
return num[0]
def get_detectors():
n = get_num_detectors()
arg = [ffi.new('char []', 80) for _ in range(n)]
check_error(handel.xiaGetDetectors(arg))
return [ffi.string(x) for x in arg]
# int xiaGetNumDetectors(unsigned int *numDet);
# int xiaGetDetectors(char *detectors[]);
# int xiaGetDetectors_VB(unsigned int index, char *alias);
# int xiaRemoveDetector(char *alias);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment