bool IRCDDBApp::findRepeater(const wxString& rptrCall)
{

  if (rptrCall.StartsWith(wxT("XRF")) || rptrCall.StartsWith(wxT("REF")))
  {
    findReflector(rptrCall, d);
    return true;
  }

  wxString arearp_cs = rptrCall;
  arearp_cs.Replace(wxT(" "), wxT("_"));

  wxString zonerp_cs;

  wxMutexLocker lock(d->rptrMapMutex);
  
  wxString s = wxT("NONE");

  if (d->rptrMap.count(arearp_cs) == 1)
  {
    IRCDDBAppRptrObject o = d->rptrMap[arearp_cs];
    zonerp_cs = o.zonerp_cs;
    zonerp_cs.Replace(wxT("_"), wxT(" "));
    zonerp_cs.SetChar(7, wxT('G'));
    s = o.zonerp_cs;
  }

  IRCMessage * m2 = new IRCMessage(wxT("IDRT_REPEATER"));
  m2->addParam(rptrCall);
  m2->addParam(zonerp_cs);
  m2->addParam(getIPAddress(s));
  d->replyQ.putMessage(m2);

  return true;
}
void BoundaryCouette::setup()
{
  bool_point_t periodic;
  Reflector *inner_refl, *outer_refl;

  MSG_DEBUG("BoundaryCouette::setup", "Creating geometry for rotational Couette flow.");

  BoundaryArbitrary::setup();

  if (!m_periodic)
    throw gError("BoundaryCouette::setup", "Non-periodic Couette flow is not yet supported.");

  periodic.x = periodic.y = false;
  periodic.z = m_periodic;

  /* Create a new container and tell it in which direction
     the boundary is periodic.
  */
	m_container = new WallContainer(m_reflectors[0]);
  m_container->setPeriodicityFront(periodic);
  m_container->setPeriodicityBack(periodic);

  inner_refl = findReflector(m_inner_reflector);
  outer_refl = findReflector(m_outer_reflector);

  /* Create the geometry. Loop over elements of the drums edges.
     In the first loop, the vertices are being created and in the
     second loop the vertices are connected by walls.
   */

  /* Create vertices. Note: The vertices are numbered in the order
     of their creation.
   */
  for (int i = 0; i < m_n_edge_elements; ++i) {
    point_t inner_pos, outer_pos;

    inner_pos.z = outer_pos.z = 0;

    inner_pos.x = m_inner_radius * cos(i*2*M_PI/m_n_edge_elements);
    inner_pos.y = m_inner_radius * sin(i*2*M_PI/m_n_edge_elements);
    outer_pos.x = m_outer_radius * cos(i*2*M_PI/m_n_edge_elements);
    outer_pos.y = m_outer_radius * sin(i*2*M_PI/m_n_edge_elements);

    m_container->addVertex(inner_pos);
    m_container->addVertex(outer_pos);

    inner_pos.z += m_height;
    outer_pos.z += m_height;

    m_container->addVertex(inner_pos);
    m_container->addVertex(outer_pos);
  }

  /* Create walls */
  for (int i = 0; i < m_n_edge_elements; ++i) {
    /* vib = Vertex Inner Bottom */
    int next_i, vib1, vob1, vit1, vot1, vib2, vob2, vit2, vot2;

    next_i = (i+1)%m_n_edge_elements;

    vib1 = i*4;
    vob1 = i*4+1;
    vit1 = i*4+2;
    vot1 = i*4+3;

    vib2 = next_i*4;
    vob2 = next_i*4+1;
    vit2 = next_i*4+2;
    vot2 = next_i*4+3;

    ADDRECT(vib1, vib2, vit2, vit1, inner_refl);
    ADDRECT(vot1, vot2, vob2, vob1, outer_refl);
  }

	m_container->updateBoundingBox();
}