Revision 66 hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/SysStateController.groovy

View differences:

SysStateController.groovy
7 7
	
8 8
    def main = {
9 9
		
10
		List inDevices = DeviceInfo.findAllByInputDevice(true, [sort:'friendlyName', order:'asc'])
10
		def crit1 = DeviceInfo.createCriteria()
11
		List inDevices = crit1 {
12
			and {
13
				eq("inputDevice",true)
14
				eq("hwSet",session.hwSet)
15
			}
16
			order("friendlyName","asc")
17
		}
18
		
11 19
		List inDevicesData = new ArrayList()
12 20
		inDevices.each {
13 21
			Map inDeviceDataEntry = new HashMap()
......
17 25
			inDevicesData << inDeviceDataEntry
18 26
		}
19 27
		
20
		List outDevices = DeviceInfo.findAllByOutputDevice(true, [sort:'friendlyName', order:'asc'])
28
		def crit2 = DeviceInfo.createCriteria()
29
		List outDevices = crit2 {
30
			and {
31
				eq("outputDevice",true)
32
				eq("hwSet",session.hwSet)
33
			}
34
			order("friendlyName","asc")
35
		}
36

  
21 37
		List outDevicesData = new ArrayList()
22 38
		outDevices.each {
23 39
			Map outDeviceDataEntry = new HashMap()
......
33 49
	
34 50
	def measure = {
35 51
		
36
		List inDevices = DeviceInfo.findAllByInputDevice(true, [sort:'friendlyName', order:'asc'])
52
		def crit1 = DeviceInfo.createCriteria()
53
		List inDevices = crit1 {
54
			and {
55
				eq("inputDevice",true)
56
				eq("hwSet",session.hwSet)
57
			}
58
			order("friendlyName","asc")
59
		}
60
		
37 61
		List inDevicesData = new ArrayList()
38 62
		inDevices.each {
39 63
			Map inDeviceDataEntry = new HashMap()
......
92 116
	
93 117
	def actions = {
94 118
		
95
		List outDevices = DeviceInfo.findAllByOutputDevice(true, [sort:'friendlyName', order:'asc'])
119
		def crit2 = DeviceInfo.createCriteria()
120
		List outDevices = crit2 {
121
			and {
122
				eq("outputDevice",true)
123
				eq("hwSet",session.hwSet)
124
			}
125
			order("friendlyName","asc")
126
		}
127
		
96 128
		List outDevicesData = new ArrayList()
97 129
		outDevices.each {
98 130
			Map outDeviceDataEntry = new HashMap()

Also available in: Unified diff