added tags $hddmb, $hddgb

This commit is contained in:
arcan1s 2014-04-07 21:19:32 +04:00
parent 45de9145fb
commit cd99f059ff
5 changed files with 26 additions and 4 deletions

View File

@ -1,6 +1,7 @@
Ver.1.7.5:
+ added scrollbar to configuration interface
+ added AC lines configuration
+ added $hddmbN, %hddgbN tags
Ver.1.7.4:
+ added support more than 10 tags in cpu, cpuclock, hdd, hddtemp, temp labels

View File

@ -1,6 +1,7 @@
Вер.1.7.5:
+ добавлены скроллбары в конфигурационный интерфейс
+ добавлена настройка значений AC
+ добавлены теги $hddmbN, $hddgbN
Вер.1.7.4:
+ добавлена поддержка более чем 10 тэгов в полях cpu, cpuclock, hdd, hddtemp, temp

View File

@ -186,7 +186,6 @@ TODO (wish list)
----------------
* data labels on tooltip
* package manager support
* hddmb support
* ps count and ps support
Links

View File

@ -53,6 +53,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 + "/usedspace", self.parent, interval)
if (bools['hddtemp'] > 0):
dataEngines['ext'].connectSource("hddtemp", self.parent, interval)
if (bools['mem'] > 0):
@ -118,11 +119,16 @@ class DataEngine:
updatedData['name'] = "gputemp"
value = round(data[QString(u'GPUTemp')].toFloat()[0], 1)
updatedData['value'] = "%4.1f" % (value)
elif (sourceName.split('/')[0] == "partitions"):
elif (sourceName.split('/')[0] == "partitions") and (sourceName.split('/')[-1] == "filllevel"):
updatedData['name'] = "hdd"
updatedData['type'] = '/' + '/'.join(sourceName.split('/')[1:-1])
value = round(data[QString(u'value')].toFloat()[0], 1)
updatedData['value'] = "%5.1f" % (value)
updatedData['value'] = value
elif (sourceName.split('/')[0] == "partitions") and (sourceName.split('/')[-1] == "usedspace"):
updatedData['name'] = "hddmb"
updatedData['type'] = '/' + '/'.join(sourceName.split('/')[1:-1])
value = data[QString(u'value')].toFloat()[0]
updatedData['value'] = value
elif (sourceName == "hddtemp"):
updatedData['name'] = "hddtemp"
updatedData['value'] = {}
@ -267,6 +273,7 @@ class DataEngine:
elif (name == "hdd"):
for item in keys['hdd']:
dataEngines['system'].disconnectSource("partitions" + item + "/filllevel", self.parent)
dataEngines['system'].disconnectSource("partitions" + item + "/usedspace", self.parent)
elif (name == "hddtemp"):
dataEngines['ext'].disconnectSource("hddtemp", self.parent)
elif (name == "mem"):

View File

@ -180,6 +180,7 @@ class pyTextWidget(plasmascript.Applet):
self.ptm['values']['cpu'][i] = 0.0
self.ptm['values']['cpuclock'][i] = 0.0
self.ptm['values']['hdd'] = {}
self.ptm['values']['hddmb'] = {}
self.ptm['values']['hddtemp'] = {}
self.ptm['values']['mem'] = {'app':0.0, 'used':0.0, 'free':1.0}
self.ptm['values']['net'] = {"up":0.0, "down":0.0}
@ -348,9 +349,20 @@ class pyTextWidget(plasmascript.Applet):
devices.reverse()
for i in devices:
if (line.split('$hdd' + str(i))[0] != line):
hdd = "%4.1f" % (self.ptm['values']['hdd'][self.ptm['names']['hdd'][i]])
line = line.split('$hdd' + str(i))[0] +\
str(self.ptm['values']['hdd'][self.ptm['names']['hdd'][i]]) +\
hdd +\
line.split('$hdd' + str(i))[1]
if (line.split('$hddmb' + str(i))[0] != line):
hdd = "%i" % (self.ptm['values']['hddmb'][self.ptm['names']['hdd'][i]] / 1024.0)
line = line.split('$hddmb' + str(i))[0] +\
str(int(self.ptm['values']['hddmb'][self.ptm['names']['hdd'][i]] / 1024.0)) +\
line.split('$hddmb' + str(i))[1]
if (line.split('$hddgb' + str(i))[0] != line):
hdd = "%4.1f" % (self.ptm['values']['hddmb'][self.ptm['names']['hdd'][i]] / (1024.0 * 1024.0))
line = line.split('$hddgb' + str(i))[0] +\
hdd +\
line.split('$hddgb' + str(i))[1]
text = self.ptm['vars']['app']['format'][0] + line + self.ptm['vars']['app']['format'][1]
self.setText("hdd", text)
@ -457,6 +469,8 @@ class pyTextWidget(plasmascript.Applet):
for item in ['hdd', 'hddtemp', 'temp']:
for value in self.ptm['names'][item]:
self.ptm['values'][item][value] = 0.0
if (item == "hdd"):
self.ptm['values']['hddmb'][value] = 0.0
def connectToEngine(self):