blisslima.mac 1.5 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
need bliss

#################################
# Lima/CCD detector settings
#################################

# <lima-name>
def limasettingssetup '{
    local lima_name lima_class

    if (!BLISS["device"])
        blisssetup

    lima_name = ($# > 0) ? "$1" : getval("Enter the Lima detector name", "det1")
    if (list_check(LIMA_DEV, lima_name) <= 0) {
        printf("Invalid Lima detector name: %s\n", lima_name)
        exit
    }

    lima_class = lima_get_setting_class(lima_name)
    bliss_register_settings_class(lima_class, "lima_dump_object_settings", \
                                              "lima_load_object_settings")
    bliss_add_settings_object(lima_class, lima_name)
    setup_tail("limasettings", lima_name)
}'

def limasettingsunsetup '{
    local lima_name lima_class
    lima_name = "$1"
    lima_class = lima_get_settings_class(lima_name)
    if (bliss_del_settings_object(lima_class, lima_name))
        bliss_unregister_settings_class(lima_class)
}'

def lima_get_settings_class(lima_name) '{
    return sprintf("lima.%s", LIMA_DEV[lima_name]["type"])
}'

def lima_dump_object_settings(lima_class, lima_name) '{
    local obj_settings[]
    return obj_settings
}'

def lima_load_object_settings(lima_class, lima_name, settings_dict) '{
    local req_defaults i
  
    req_defaults = bliss_is_default_settings(settings_dict)
    if (req_defaults)
        lima_load_default_settings()
    if (!req_defaults) {

    }

    lima_resetup()
}'

def lima_load_default_settings() '{
}'

def lima_resetup() '{

}'