static char SystemMicros_id[] = "$Header: /usr/tiburon/unix/gui/tmacs/RCS/SystemMicros.cc,v 1.2 1997/03/20 12:30:57 oreilly Exp $";


/*
$Log: SystemMicros.cc,v $
Revision 1.2  1997/03/20 12:30:57  oreilly
..

Revision 1.1  96/07/22  10:42:10  10:42:10  oreilly (Thomas C. O'Reilly)
First external release

*/

#include "TiburonApp.h"
#include "SystemMicros.h"
#include "VehicleConfiguration.h"
#include "Micro.h"

SystemMicros::SystemMicros()
{
  buildLists(((TiburonApp *)theApplication)->vehicleConfig->vehicleBase);
}


void SystemMicros::buildLists(VehicleComponent *parent)
{
  VehicleComponent **child;
  parent->children.reset();
  while (child = parent->children.next())
  {
    if ((*child)->type() == VehicleComponent::IbcType ||
	(*child)->type() == VehicleComponent::DconType)
    {
      Ibc *ibc = (Ibc *)(*child);
      DconDm *dconDm = new DconDm(ibc->name(), ibc->dmPrefix());
      if (dconDm->error())
      {
	char errorBuf[errorMsgSize];
	dconDm->errorMsg(errorBuf);
	setError(errorBuf);
      }
      else
      {
	if ((*child)->type() == VehicleComponent::DconType)
	  dconDm->hasJbox(True);
	else
	  dconDm->hasJbox(False);
	
	dconDms.add(&dconDm);
      }
    }

    buildLists(*child);
    if (error())
      return;
  }
}


