|
From: <tf...@us...> - 2009-08-08 03:41:00
|
Revision: 21126
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=21126&view=rev
Author: tfoote
Date: 2009-08-08 03:40:53 +0000 (Sat, 08 Aug 2009)
Log Message:
-----------
removing DiagnosticString and DiagnosticValue and last few references to them #1903
Modified Paths:
--------------
pkg/trunk/calibration/joint_calibration_monitor/src/joint_calibration_monitor/generic_joint_monitor.py
pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py
pkg/trunk/pr2/pr2_computer_monitor/scripts/cpu_monitor.py
pkg/trunk/pr2/pr2_computer_monitor/scripts/hd_monitor.py
pkg/trunk/stacks/hardware_test/diagnostic_test/src/diagnostic_test/expected.py
Removed Paths:
-------------
pkg/trunk/stacks/common_msgs/diagnostic_msgs/msg/DiagnosticString.msg
pkg/trunk/stacks/common_msgs/diagnostic_msgs/msg/DiagnosticValue.msg
Modified: pkg/trunk/calibration/joint_calibration_monitor/src/joint_calibration_monitor/generic_joint_monitor.py
===================================================================
--- pkg/trunk/calibration/joint_calibration_monitor/src/joint_calibration_monitor/generic_joint_monitor.py 2009-08-08 03:37:17 UTC (rev 21125)
+++ pkg/trunk/calibration/joint_calibration_monitor/src/joint_calibration_monitor/generic_joint_monitor.py 2009-08-08 03:40:53 UTC (rev 21126)
@@ -69,8 +69,8 @@
#diag.values.append(KeyValue(value=timestamp, label="Time"))
# Display the actuator and joint names for this monitor
- diag.strings.append(DiagnosticString(value=self._actuator, label="Actuator"))
- diag.strings.append(DiagnosticString(value=self._joint, label="Joint"))
+ diag.strings.append(KeyValue(value=self._actuator, label="Actuator"))
+ diag.strings.append(KeyValue(value=self._joint, label="Joint"))
# Check if we can find both the joint and actuator
act_names = [x.name for x in mech_state.actuator_states]
@@ -113,8 +113,8 @@
flag_deadbands = len([x for x in self._hist if x == FLAG_DEADBAND])
flag_errors = len([x for x in self._hist if x == FLAG_ERROR])
- diag.strings.append(DiagnosticString(value=self._flag_lookup[sample_result],
- label="Flag Check Result"))
+ diag.strings.append(KeyValue(value=self._flag_lookup[sample_result],
+ label="Flag Check Result"))
diag.values.append(KeyValue(value=flag_oks,
label="Flag OKs"))
Modified: pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py
===================================================================
--- pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py 2009-08-08 03:37:17 UTC (rev 21125)
+++ pkg/trunk/pr2/life_test/src/life_test/trans_monitor.py 2009-08-08 03:40:53 UTC (rev 21126)
@@ -97,10 +97,10 @@
diag.values = [ ]
diag.strings = [ ]
- diag.strings.append(DiagnosticString(value=self._joint, label="Joint"))
- diag.strings.append(DiagnosticString(value=self._actuator, label="Actuator"))
- diag.strings.append(DiagnosticString(value=str(self._positive), label="Positive Joint"))
- diag.strings.append(DiagnosticString(value=str(self._continuous), label="Continuous Joint"))
+ diag.strings.append(KeyValue(value=self._joint, label="Joint"))
+ diag.strings.append(KeyValue(value=self._actuator, label="Actuator"))
+ diag.strings.append(KeyValue(value=str(self._positive), label="Positive Joint"))
+ diag.strings.append(KeyValue(value=str(self._continuous), label="Continuous Joint"))
diag.values.append(KeyValue(value=float(self._ref_position), label="Reference Position"))
diag.values.append(KeyValue(value=float(self._deadband), label="Deadband"))
diag.values.append(KeyValue(value=float(self._rx_count), label="Mech State RX Count"))
@@ -122,8 +122,8 @@
calibrated = (mech_state.joint_states[joint_names.index(self._joint)].is_calibrated == 1)
- diag.strings.append(DiagnosticString(value=str(act_exists), label='Actuator Exists'))
- diag.strings.append(DiagnosticString(value=str(joint_exists), label='Joint Exists'))
+ diag.strings.append(KeyValue(value=str(act_exists), label='Actuator Exists'))
+ diag.strings.append(KeyValue(value=str(joint_exists), label='Joint Exists'))
@@ -147,9 +147,9 @@
diag.message = 'Broken'
diag.level = 2
- diag.strings.insert(0, DiagnosticString(value=diag.message, label='Transmission Status'))
- diag.strings.insert(1, DiagnosticString(value=reading_msg, label='Current Reading'))
- diag.strings.append(DiagnosticString(value=str(calibrated), label='Is Calibrated'))
+ diag.strings.insert(0, KeyValue(value=diag.message, label='Transmission Status'))
+ diag.strings.insert(1, KeyValue(value=reading_msg, label='Current Reading'))
+ diag.strings.append(KeyValue(value=str(calibrated), label='Is Calibrated'))
diag.values.append(KeyValue(value=cal_reading, label='Calibration Reading'))
diag.values.append(KeyValue(value=position, label='Joint Position'))
Modified: pkg/trunk/pr2/pr2_computer_monitor/scripts/cpu_monitor.py
===================================================================
--- pkg/trunk/pr2/pr2_computer_monitor/scripts/cpu_monitor.py 2009-08-08 03:37:17 UTC (rev 21125)
+++ pkg/trunk/pr2/pr2_computer_monitor/scripts/cpu_monitor.py 2009-08-08 03:40:53 UTC (rev 21126)
@@ -70,12 +70,12 @@
if retcode != 0:
diag_level = 2
diag_msg = [ 'ipmitool Error' ]
- diag_strs = [ DiagnosticString(label = 'IPMI Error', value = stderr) ]
+ diag_strs = [ KeyValue(label = 'IPMI Error', value = stderr) ]
return diag_strs, diag_vals, diag_msgs, diag_level
lines = stdout.split('\n')
if len(lines) < 2:
- diag_strs = [ DiagnosticString(label = 'ipmitool status', value = 'No output') ]
+ diag_strs = [ KeyValue(label = 'ipmitool status', value = 'No output') ]
diag_msgs = [ 'No response' ]
diag_level = 2
return diag_strs, diag_vals, diag_msgs, diag_level
@@ -112,7 +112,7 @@
else:
- diag_strs.append(DiagnosticString(label = name, value = words[1]))
+ diag_strs.append(KeyValue(label = name, value = words[1]))
# MP, BP, FP temps
@@ -132,7 +132,7 @@
diag_msgs.append('%s Hot' % dev_name)
else:
- diag_strs.append(DiagnosticString(label = name, value = ipmi_val))
+ diag_strs.append(KeyValue(label = name, value = ipmi_val))
# CPU fan speeds
if (name.startswith('CPU') and name.endswith('Fan')) or name == 'MB Fan':
@@ -142,19 +142,19 @@
rpm = float(rpm)
diag_vals.append(KeyValue(label = name, value = rpm))
else:
- diag_strs.append(DiagnosticString(label = name, value = ipmi_val))
+ diag_strs.append(KeyValue(label = name, value = ipmi_val))
# If CPU is hot we get an alarm from ipmitool, report that too
if name.startswith('CPU') and name.endswith('hot'):
if ipmi_val == '0x01':
- diag_strs.append(DiagnosticString(label = name, value = 'OK'))
+ diag_strs.append(KeyValue(label = name, value = 'OK'))
else:
- diag_strs.append(DiagnosticString(label = name, value = 'Hot'))
+ diag_strs.append(KeyValue(label = name, value = 'Hot'))
diag_level = max(diag_level, 2)
diag_msgs.append('CPU Hot Alarm')
except Exception, e:
- diag_strs.append(DiagnosticString(label = 'Exception', value = traceback.format_exc()))
+ diag_strs.append(KeyValue(label = 'Exception', value = traceback.format_exc()))
diag_level = 2
diag_msgs.append('Exception')
@@ -183,7 +183,7 @@
if retcode != 0:
diag_level = 2
diag_msg = [ 'Core Temp Error' ]
- diag_strs = [ DiagnosticString(label = 'Core Temp Error', value = stderr), DiagnosticString(label = 'Output', value = stdout) ]
+ diag_strs = [ KeyValue(label = 'Core Temp Error', value = stderr), KeyValue(label = 'Output', value = stdout) ]
return diag_strs, diag_vals, diag_msgs, diag_level
tmp = stdout.strip()
@@ -199,7 +199,7 @@
diag_msgs.append('Hot')
else:
- diag_strs.append(DiagnosticString(label = 'Core %s Temp' % index, value = tmp))
+ diag_strs.append(KeyValue(label = 'Core %s Temp' % index, value = tmp))
return diag_strs, diag_vals, diag_msgs, diag_level
@@ -220,8 +220,8 @@
if retcode != 0:
lvl = 2
msgs = [ 'Clock speed error' ]
- strs = [ DiagnosticString(label = 'Clock speed error', value = stderr),
- DiagnosticString(label = 'Output', value = stdout) ]
+ strs = [ KeyValue(label = 'Clock speed error', value = stderr),
+ KeyValue(label = 'Output', value = stdout) ]
return (strs, vals, msgs, lvl)
@@ -242,7 +242,7 @@
else:
lvl = max(lvl, 2)
- strs.append(DiagnosticString(label = 'Core %d Speed' % index, value = speed))
+ strs.append(KeyValue(label = 'Core %d Speed' % index, value = speed))
if not enforce_speed:
lvl = 0
@@ -256,7 +256,7 @@
rospy.logerr(traceback.format_exc())
lvl = 2
msgs.append('Exception')
- strs.append(DiagnosticString(label = 'Exception', value = traceback.format_exc()))
+ strs.append(KeyValue(label = 'Exception', value = traceback.format_exc()))
return strs, vals, msgs, lvl
@@ -265,7 +265,7 @@
def check_uptime():
level = 0
vals = []
- str = DiagnosticString(label = 'Load Average Status', value = 'Error')
+ str = KeyValue(label = 'Load Average Status', value = 'Error')
try:
p = subprocess.Popen('uptime', stdout = subprocess.PIPE,
@@ -289,19 +289,19 @@
if load1 > 35 or load5 > 25 or load15 > 20:
level = 2
- str = DiagnosticString(label = 'Load Average Status', value = stat_dict[level])
+ str = KeyValue(label = 'Load Average Status', value = stat_dict[level])
except Exception, e:
rospy.logerr(traceback.format_exc())
level = 2
- str = DiagnosticString(label = 'Load Average Status', value = str(e))
+ str = KeyValue(label = 'Load Average Status', value = str(e))
return level, vals, str
# Add msgs output
def check_memory():
values = []
- str = DiagnosticString(label = 'Memory Status', value = 'Exception')
+ str = KeyValue(label = 'Memory Status', value = 'Exception')
level = 2
msg = ''
@@ -331,7 +331,7 @@
if free_mem < 5:
level = 2
- str = DiagnosticString(label = 'Total Memory', value = mem_dict[level])
+ str = KeyValue(label = 'Total Memory', value = mem_dict[level])
msg = mem_dict[level]
except Exception, e:
@@ -385,12 +385,12 @@
if user + nice> 90.0:
core_level = 2
- strs.append(DiagnosticString(label = 'CPU %s Status' % cpu_name, value = load_dict[core_level]))
+ strs.append(KeyValue(label = 'CPU %s Status' % cpu_name, value = load_dict[core_level]))
mp_level = max(mp_level, core_level)
except Exception, e:
mp_level = 2
- strs.append(DiagnosticString(label = 'mpstat Exception', value = str(e)))
+ strs.append(KeyValue(label = 'mpstat Exception', value = str(e)))
return mp_level, vals, strs
@@ -431,7 +431,7 @@
stat.strings.pop(0)
stat.values.pop(0)
- stat.strings.insert(0, DiagnosticString(label = 'Update Status', value = stale_status))
+ stat.strings.insert(0, KeyValue(label = 'Update Status', value = stale_status))
stat.values.insert(0, KeyValue(label = 'Time Since Update', value = time_since_update))
class CPUMonitor():
@@ -454,7 +454,7 @@
self._temp_stat.level = 2
self._temp_stat.hardware_id = hostname
self._temp_stat.message = 'No Data'
- self._temp_stat.strings = [ DiagnosticString(label = 'Update Status', value = 'No Data' )]
+ self._temp_stat.strings = [ KeyValue(label = 'Update Status', value = 'No Data' )]
self._temp_stat.values = [ KeyValue(label = 'Time Since Last Update', value = 100000 )]
self._usage_stat = DiagnosticStatus()
@@ -462,7 +462,7 @@
self._usage_stat.level = 2
self._usage_stat.hardware_id = hostname
self._usage_stat.message = 'No Data'
- self._usage_stat.strings = [ DiagnosticString(label = 'Update Status', value = 'No Data' )]
+ self._usage_stat.strings = [ KeyValue(label = 'Update Status', value = 'No Data' )]
self._usage_stat.values = [ KeyValue(label = 'Time Since Last Update', value = 100000 )]
self._nfs_stat = DiagnosticStatus()
@@ -470,7 +470,7 @@
self._nfs_stat.level = 2
self._nfs_stat.hardware_id = hostname
self._nfs_stat.message = 'No Data'
- self._nfs_stat.strings = [ DiagnosticString(label = 'Update Status', value = 'No Data' )]
+ self._nfs_stat.strings = [ KeyValue(label = 'Update Status', value = 'No Data' )]
self._nfs_stat.values = [ KeyValue(label = 'Time Since Last Update', value = 100000 )]
self._last_temp_time = 0
@@ -509,7 +509,7 @@
nfs_level = 0
msg = 'OK'
- strs = [ DiagnosticString(label = 'Update Status', value = 'OK' )]
+ strs = [ KeyValue(label = 'Update Status', value = 'OK' )]
vals = [ KeyValue(label = 'Time Since Last Update', value = 0 )]
try:
@@ -552,7 +552,7 @@
rospy.logerr(traceback.format_exc())
nfs_level = 2
msg = 'Exception'
- strings.append(DiagnosticString(label = 'Exception', value = str(e)))
+ strings.append(KeyValue(label = 'Exception', value = str(e)))
self._mutex.acquire()
@@ -579,7 +579,7 @@
self._mutex.release()
return
- diag_strs = [ DiagnosticString(label = 'Update Status', value = 'OK' ) ]
+ diag_strs = [ KeyValue(label = 'Update Status', value = 'OK' ) ]
diag_vals = [ KeyValue(label = 'Time Since Last Update', value = 0 ) ]
diag_msgs = []
diag_level = 0
@@ -633,7 +633,7 @@
return
diag_level = 0
- diag_strs = [ DiagnosticString(label = 'Update Status', value = 'OK' ) ]
+ diag_strs = [ KeyValue(label = 'Update Status', value = 'OK' ) ]
diag_vals = [ KeyValue(label = 'Time Since Last Update', value = 0 )]
# Check mpstat
Modified: pkg/trunk/pr2/pr2_computer_monitor/scripts/hd_monitor.py
===================================================================
--- pkg/trunk/pr2/pr2_computer_monitor/scripts/hd_monitor.py 2009-08-08 03:37:17 UTC (rev 21125)
+++ pkg/trunk/pr2/pr2_computer_monitor/scripts/hd_monitor.py 2009-08-08 03:40:53 UTC (rev 21126)
@@ -48,7 +48,7 @@
import socket
-from diagnostic_msgs.msg import *
+from diagnostic_msgs.msg import DiagnosticArray, DiagnosticStatus, KeyValue
low_hd_level = 5
critical_hd_level = 1
@@ -109,7 +109,7 @@
stat.strings.pop(0)
stat.values.pop(0)
- stat.strings.insert(0, DiagnosticString(label = 'Update Status', value = stale_status))
+ stat.strings.insert(0, KeyValue(label = 'Update Status', value = stale_status))
stat.values.insert(0, KeyValue(label = 'Time Since Update', value = time_since_update))
class hdMonitor():
@@ -129,7 +129,7 @@
self._temp_stat.level = 2
self._temp_stat.hardware_id = hostname
self._temp_stat.message = 'No Data'
- self._temp_stat.strings = [ DiagnosticString(label = 'Update Status', value = 'No Data' )]
+ self._temp_stat.strings = [ KeyValue(label = 'Update Status', value = 'No Data' )]
self._temp_stat.values = [ KeyValue(label = 'Time Since Last Update', value = 100000 )]
if self._home_dir != '':
@@ -137,7 +137,7 @@
self._usage_stat.level = 2
self._usage_stat.hardware_id = hostname
self._usage_stat.name = '%s HD Usage' % hostname
- self._usage_stat.strings = [ DiagnosticString(label = 'Update Status', value = 'No Data' )]
+ self._usage_stat.strings = [ KeyValue(label = 'Update Status', value = 'No Data' )]
self._usage_stat.values = [ KeyValue(label = 'Time Since Last Update', value = 100000) ]
self.check_disk_usage()
@@ -169,7 +169,7 @@
self._mutex.release()
return
- diag_strs = [ DiagnosticString(label = 'Update Status', value = 'OK' ) ]
+ diag_strs = [ KeyValue(label = 'Update Status', value = 'OK' ) ]
diag_vals = [ KeyValue(label = 'Time Since Last Update', value = 0 ) ]
diag_level = 0
diag_message = 'OK'
@@ -185,9 +185,9 @@
temp_level = 2
diag_level = max(diag_level, temp_level)
- diag_strs.append(DiagnosticString(label = 'Disk %d Temp Status' % index, value = temp_dict[temp_level]))
- diag_strs.append(DiagnosticString(label = 'Disk %d Mount Pt.' % index, value = drives[index]))
- diag_strs.append(DiagnosticString(label = 'Disk %d Device ID' % index, value = makes[index]))
+ diag_strs.append(KeyValue(label = 'Disk %d Temp Status' % index, value = temp_dict[temp_level]))
+ diag_strs.append(KeyValue(label = 'Disk %d Mount Pt.' % index, value = drives[index]))
+ diag_strs.append(KeyValue(label = 'Disk %d Device ID' % index, value = makes[index]))
diag_vals.append(KeyValue(label = 'Disk %d Temp' % index, value = temp))
if not temp_ok:
@@ -228,7 +228,7 @@
self._mutex.release()
return
- diag_strs = [ DiagnosticString(label = 'Update Status', value = 'OK' ) ]
+ diag_strs = [ KeyValue(label = 'Update Status', value = 'OK' ) ]
diag_vals = [ KeyValue(label = 'Time Since Last Update', value = 0 ) ]
diag_level = 0
diag_message = 'OK'
@@ -241,7 +241,7 @@
if (retcode == 0):
- diag_strs.append(DiagnosticString(label = 'Disk Space Reading', value = 'OK'))
+ diag_strs.append(KeyValue(label = 'Disk Space Reading', value = 'OK'))
row_count = 0
for row in stdout.split('\n'):
if len(row.split()) < 2:
@@ -262,22 +262,22 @@
else:
level = 2
- diag_strs.append(DiagnosticString(
+ diag_strs.append(KeyValue(
label = 'Disk %d Name' % row_count, value = name))
- diag_vals.append(DiagnosticString(
+ diag_vals.append(KeyValue(
label = 'Disk %d Available' % row_count, value = g_available))
- diag_vals.append(DiagnosticString(
+ diag_vals.append(KeyValue(
label = 'Disk %d Size' % row_count, value = size))
- diag_strs.append(DiagnosticString(
+ diag_strs.append(KeyValue(
label = 'Disk %d Status' % row_count, value = stat_dict[level]))
- diag_strs.append(DiagnosticString(
+ diag_strs.append(KeyValue(
label = 'Disk %d Mount Point' % row_count, value = mount_pt))
diag_level = max(diag_level, level)
diag_message = usage_dict[diag_level]
else:
- diag_strs.append(DiagnosticString(label = 'Disk Space Reading', value = 'Failed'))
+ diag_strs.append(KeyValue(label = 'Disk Space Reading', value = 'Failed'))
diag_level = 2
diag_message = stat_dict[diag_level]
@@ -285,8 +285,8 @@
except:
rospy.logerr(traceback.format_exc())
- diag_strs.append(DiagnosticString(label = 'Disk Space Reading', value = 'Exception'))
- diag_strs.append(DiagnosticString(label = 'Disk Space Ex', value = traceback.format_exc()))
+ diag_strs.append(KeyValue(label = 'Disk Space Reading', value = 'Exception'))
+ diag_strs.append(KeyValue(label = 'Disk Space Ex', value = traceback.format_exc()))
diag_level = 2
diag_message = stat_dict[diag_level]
Deleted: pkg/trunk/stacks/common_msgs/diagnostic_msgs/msg/DiagnosticString.msg
===================================================================
--- pkg/trunk/stacks/common_msgs/diagnostic_msgs/msg/DiagnosticString.msg 2009-08-08 03:37:17 UTC (rev 21125)
+++ pkg/trunk/stacks/common_msgs/diagnostic_msgs/msg/DiagnosticString.msg 2009-08-08 03:40:53 UTC (rev 21126)
@@ -1,2 +0,0 @@
-string value # a string data type
-string label # what to label this value when viewing
Deleted: pkg/trunk/stacks/common_msgs/diagnostic_msgs/msg/DiagnosticValue.msg
===================================================================
--- pkg/trunk/stacks/common_msgs/diagnostic_msgs/msg/DiagnosticValue.msg 2009-08-08 03:37:17 UTC (rev 21125)
+++ pkg/trunk/stacks/common_msgs/diagnostic_msgs/msg/DiagnosticValue.msg 2009-08-08 03:40:53 UTC (rev 21126)
@@ -1,2 +0,0 @@
-float32 value # a value to track over time
-string label # what to label this value when viewing
Modified: pkg/trunk/stacks/hardware_test/diagnostic_test/src/diagnostic_test/expected.py
===================================================================
--- pkg/trunk/stacks/hardware_test/diagnostic_test/src/diagnostic_test/expected.py 2009-08-08 03:37:17 UTC (rev 21125)
+++ pkg/trunk/stacks/hardware_test/diagnostic_test/src/diagnostic_test/expected.py 2009-08-08 03:40:53 UTC (rev 21126)
@@ -62,7 +62,7 @@
else:
msg = 'Missing - Error'
status.level = max(status.level, 2)
- status.strings.append(DiagnosticString(label = name, value = msg))
+ status.strings.append(KeyValue(label = name, value = msg))
if "desired_present" in parameters:
@@ -75,7 +75,7 @@
else:
msg = 'Missing - Warning'
status.level = max(status.level, 1)
- status.strings.append(DiagnosticString(label = name, value = msg))
+ status.strings.append(KeyValue(label = name, value = msg))
status.message = stat_dict[status.level]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|