Beispiel #1
0
string ChannelizerOperation::runThroughChannelizerList(
   const string &channelizerName, Site *site)
{
   Assert(site);
   ChannelizerList channelizerList;
   site->channelizerManager()->getProxyList(&channelizerList);

   string resultsString;
   bool found = false;
   for (ChannelizerList::iterator index = channelizerList.begin();
	index != channelizerList.end(); ++index)
   {
      ChannelizerProxy *channelizerProxy = *index;
      Assert(channelizerProxy);
      if ( (channelizerName == "all") || 
	   channelizerProxy->getName() == channelizerName)
      {
	 found = true;
	 resultsString += callOperation(channelizerProxy);
      }
   }

   if (found)
   {
      // if the command had no output text of its own,
      // return a generic acknowledgement.
      if (resultsString.empty())
      {
	 resultsString =  "channelizer command sent.";
      }
   }
   else 
   {
      resultsString = "The requested channelizer(s) are not connected: "
	 + channelizerName;
   }

   return resultsString;

}
ChannelizerList NssComponentTree::getChansForBeams(std::vector<std::string> beamNames)
{
    ChannelizerList localChannelizerList;

    // Go through list of chan proxies.  For each one whose beam is 
    // on the incoming beamNames argument, add it to the local list
    for (ChannelizerList::iterator it = internal_->chanList_.begin();
	 it != internal_->chanList_.end(); ++it)
    {
	ChannelizerProxy *chanProxy = *it;
//cout << "Chan Name " << chanProxy->getName() << endl;
	string beamForChan = internal_->expectedNssComponentsTree_->getBeamForChan(chanProxy->getName());
//cout << "Beam " << beamForChan << endl;
	if (find(beamNames.begin(), beamNames.end(), beamForChan)
	    != beamNames.end())
	{
	    localChannelizerList.push_back(chanProxy);
	}
    }

    return localChannelizerList;
}