Output slave headers in 'ethercat slaves'; show alias only if set.
authorFlorian Pose <fp@igh-essen.com>
Fri, 27 Jun 2008 09:53:09 +0000
changeset 1069 ab0c21d9ab2b
parent 1068 df1c8e4f0577
child 1070 348249d1f95c
Output slave headers in 'ethercat slaves'; show alias only if set.
tools/Master.cpp
--- a/tools/Master.cpp	Fri Jun 27 09:48:45 2008 +0000
+++ b/tools/Master.cpp	Fri Jun 27 09:53:09 2008 +0000
@@ -1435,8 +1435,12 @@
     
     getSlave(&slave, slavePosition);
         
-    cout << "Slave " << dec << slavePosition << endl
-        << "Alias: " << slave.alias << endl
+    cout << "=== Slave " << dec << slavePosition << " ===" << endl;
+    
+    if (slave.alias)
+        cout << "Alias: " << slave.alias << endl;
+
+    cout
         << "State: " << slaveState(slave.state) << endl
         << "Flag: " << (slave.error_flag ? 'E' : '+') << endl
         << "Identity:" << endl
@@ -1519,7 +1523,6 @@
             << "  Current consumption: "
             << dec << slave.current_on_ebus << " mA" << endl;
     }
-    cout << endl;
 }
 
 /****************************************************************************/