Project

General

Profile

Feature #994 » cabling_detector.py

Wilson, Antony, 17 July 2012 09:41

 
1
#!/usr/bin/env python
2
""" Cabling """
3

    
4
from cdb import Cabling
5

    
6
_TEST_SERVER = 'http://rgma19.pp.rl.ac.uk:8080'
7
_CABLING = Cabling(_TEST_SERVER)
8

    
9
print "API Version: " + _CABLING.get_version()
10
print "Server name: " + _CABLING.get_name()
11

    
12
print _CABLING
13

    
14
print "Devices:" + str(_CABLING.list_devices())
15

    
16
_DEVICE = 'EMR'
17
_TYPE = 'test'
18
_TS = '2012-05-27 12:00:00.0'
19
_TS_END = '2012-06-27 12:00:00.0'
20
_ID = 1
21

    
22
_CURRENT_CABLING = _CABLING.get_current_cabling(_DEVICE)
23
print "Current cabling for detector"
24
print _CURRENT_CABLING 
25

    
26
_RUN_CABLING = _CABLING.get_cabling_for_run(_DEVICE, 4161)
27
print "Cabling for run"
28
print _RUN_CABLING
29

    
30
_DATE_CABLING = _CABLING.get_cabling_for_date(_DEVICE, _TS)
31
print "Cabling for date"
32
print _DATE_CABLING
33

    
34
_ID_CABLING = _CABLING.get_cabling_for_id(_ID)
35
print "Cabling for id"
36
print _ID_CABLING
37

    
38
_IDS = _CABLING.get_ids(_TS, _TS_END) 
39
print "Cabling ids"
40
for _id in _IDS:
41
    print "id:" + _id
42
    print _IDS.get(_id)
43
    print
44

    
(1-1/2)