332 |
|
if(!_components.containsKey(dataKey)) { |
333 |
|
// check if its a disk drive, if it is then we need to deal with it |
334 |
|
if(dataKey.startsWith("packet.disk.p")) { |
335 |
< |
createDiskPanel(dataKey); |
335 |
> |
createDiskPanel(dataKey, packet); |
336 |
|
|
337 |
|
// !check for services here! to display |
338 |
|
} else if(dataKey.startsWith("packet.services.")) { |
399 |
|
* all attributes relating to that new disk. |
400 |
|
* |
401 |
|
* @param attribute the name of the attrivbute first encountered |
402 |
+ |
* @param packet the XMLPacket the data is being pulled from |
403 |
|
*/ |
404 |
< |
private void createDiskPanel(String attribute) { |
404 |
> |
private void createDiskPanel(String attribute, XMLPacket packet) { |
405 |
|
String diskNumber = ""; |
406 |
|
|
407 |
|
// pos is after "packet.disk.p" |
424 |
|
addDataComponent(new StringDataComponent(devAttribute, devAttribute)); |
425 |
|
addDataComponent(new StringDataComponent(mountAttribute, mountAttribute)); |
426 |
|
addDataComponent(new StringDataComponent(totalAttribute, totalAttribute)); |
427 |
< |
addDataComponent(new StringDataComponent("packet.disk.p" + diskNumber + ".used", "packet.disk.p" + diskNumber + ".attributes.used")); |
427 |
> |
|
428 |
> |
// add any further bits of data about this disk so we |
429 |
> |
// don't try and do something with them later |
430 |
> |
// -- this is not that tidy ;) |
431 |
> |
Set packetSet = packet.getSet(); |
432 |
> |
Iterator i = packetSet.iterator(); |
433 |
> |
while (i.hasNext()) { |
434 |
> |
String dataKey = (String) i.next(); |
435 |
> |
if(dataKey.startsWith("packet.disk.p" + diskNumber +".") && !_components.containsKey(dataKey)) { |
436 |
> |
addDataComponent(new StringDataComponent(dataKey, dataKey)); |
437 |
> |
} |
438 |
> |
} |
439 |
|
} |
440 |
|
|
441 |
|
/** |