1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 from Hardware import Hardware
16
17 from AccessControl import ClassSecurityInfo
18 from Globals import InitializeClass
19
20 from Products.ZenUtils.Utils import convToUnits
21 from Products.ZenRelations.RelSchema import *
22
23 from Exceptions import *
24
25
27
28 __pychecker__='no-override'
29
30 meta_type = "DeviceHW"
31
32 totalMemory = 0L
33
34 _properties = Hardware._properties + (
35 {'id':'totalMemory', 'type':'long', 'mode':'w'},
36 )
37
38 _relations = Hardware._relations + (
39 ("cpus", ToManyCont(ToOne, "Products.ZenModel.CPU", "hw")),
40 ("cards", ToManyCont(ToOne, "Products.ZenModel.ExpansionCard", "hw")),
41 ("harddisks", ToManyCont(ToOne, "Products.ZenModel.HardDisk", "hw")),
42 ("fans", ToManyCont(ToOne, "Products.ZenModel.Fan", "hw")),
43 ("powersupplies", ToManyCont(ToOne, "Products.ZenModel.PowerSupply",
44 "hw")),
45 ("temperaturesensors", ToManyCont(ToOne,
46 "Products.ZenModel.TemperatureSensor", "hw")),
47 )
48
49 security = ClassSecurityInfo()
50
54
55
57 pp = self.getPrimaryParent()
58 screen = getattr(pp, "deviceHardwareDetail", False)
59 if not screen: return pp()
60 return screen()
61
64
66 """Return our Device object for DeviceResultInt.
67 """
68 return self.getPrimaryParent()
69
70
71
72 InitializeClass(DeviceHW)
73