added support of $hddtotmb and $hddtotgb tags

This commit is contained in:
arcan1s
2014-05-31 14:12:04 +04:00
parent 9904e5d6c6
commit 7fc7b68358
18 changed files with 224 additions and 179 deletions

View File

@ -58,6 +58,7 @@ class DataEngine:
if (bools['hdd'] > 0):
for item in names['hdd']:
dataEngines['system'].connectSource("partitions" + item + "/filllevel", self.parent, interval)
dataEngines['system'].connectSource("partitions" + item + "/freespace", self.parent, interval)
dataEngines['system'].connectSource("partitions" + item + "/usedspace", self.parent, interval)
if (bools['hddtemp'] > 0):
dataEngines['ext'].connectSource("hddtemp", self.parent, interval)
@ -144,6 +145,11 @@ class DataEngine:
updatedData['type'] = '/' + '/'.join(sourceName.split('/')[1:-1])
value = round(data[QString(u'value')].toFloat()[0], 1)
updatedData['value'] = value
elif (sourceName.split('/')[0] == "partitions") and (sourceName.split('/')[-1] == "freespace"):
updatedData['name'] = "hddfreemb"
updatedData['type'] = '/' + '/'.join(sourceName.split('/')[1:-1])
value = data[QString(u'value')].toFloat()[0]
updatedData['value'] = value
elif (sourceName.split('/')[0] == "partitions") and (sourceName.split('/')[-1] == "usedspace"):
updatedData['name'] = "hddmb"
updatedData['type'] = '/' + '/'.join(sourceName.split('/')[1:-1])