EXPORT_C TCMSender& TCMSender::operator=(const TCMSender& aInfo)
{
	CALLSTACKITEM_N(_CL("TCMSender"), _CL("operator"));

	iName()=aInfo.iName();
	iPhoneNo()=aInfo.iPhoneNo();
	iJabberNick()=aInfo.iJabberNick();
	iBt=aInfo.iBt;
	iImei()=aInfo.iImei();

	return *this;
}
EXPORT_C CBBSensorEvent& CBBSensorEvent::operator=(const CBBSensorEvent& aSensorEvent)
{
	MBBData* val=0;
	if (aSensorEvent.iData()) val=aSensorEvent.iData()->CloneL(aSensorEvent.iData()->Name());

	iStamp()=aSensorEvent.iStamp();
	iPriority()=aSensorEvent.iPriority();
	iData.SetValue(val);
	iData.SetOwnsValue(ETrue);
	iName()=aSensorEvent.iName();
	return *this;
}
Exemplo n.º 3
0
void CSystemTestBase::HandleThreadExitL(RThread& aThread)
	{
	TExitType exitType=aThread.ExitType();
	if (exitType==EExitPanic)
		{
		CActiveScheduler::Stop();
		iExitReason = aThread.ExitReason();
		iExitCategory = aThread.ExitCategory();
		TBuf<100> iName(aThread.FullName());
		iLogger.WriteFormat(KPanicText, &iName, iExitReason, &iExitCategory);
		User::Panic(iExitCategory,iExitReason);
		}
	}
Exemplo n.º 4
0
 CodeBlob iName(std::string name) { return iName(hashName(name)); }
EXPORT_C MBBData* CBBSensorEvent::CloneL(const TDesC&) const
{
	bb_auto_ptr<CBBSensorEvent> ret(new (ELeave) CBBSensorEvent(iName(), iTupleName, iFactory));
	*ret=*this;
	return ret.release();
}
// ######################################################################
void Beobot2_GistSalLocalizerWorkerI::updateMessage
(const RobotSimEvents::EventMessagePtr& eMsg, const Ice::Current&)
{
  // Get a gist-sal message
  if(eMsg->ice_isA("::BeobotEvents::LandmarkSearchQueueMessage"))
  {
    BeobotEvents::LandmarkSearchQueueMessagePtr lsqMsg =
      BeobotEvents::LandmarkSearchQueueMessagePtr::dynamicCast(eMsg);

    //Get the current request ID
    int currRequestID = lsqMsg->RequestID;
    itsInputFnum = currRequestID;

    LINFO("Got an lsqMessage with Request ID = %d", currRequestID);

    // get the inputImage
    its_input_info_mutex.lock();
    itsInputImage = Ice2Image<PixRGB<byte> >(lsqMsg->currIma);
    //itsInputWin->setTitle(sformat("WM: %d",itsInputFnum).c_str());
    //itsInputWin->drawImage(itsInputImage, 0, 0);

    // get the salient region information
    itsInputVO.clear();
    itsVOKeypointsComputed.clear();
    itsInputObjOffset.clear();
    uint inputSize = lsqMsg->salientRegions.size();
    for(uint i = 0; i < inputSize; i++)
      {
        BeobotEvents::SalientRegion salReg = lsqMsg->salientRegions[i];
        LDEBUG("W[%4d] sp[%4d,%4d] rect[%4d,%4d,%4d,%4d]",
               i, salReg.salpt.i, salReg.salpt.j,
               salReg.objRect.tl.i, salReg.objRect.tl.j,
               salReg.objRect.br.i, salReg.objRect.br.j);

        // print the pre-attentive feature vector
        std::vector<float> features;
        uint fsize = salReg.salFeatures.size();
        for(uint j = 0; j < fsize; j++)
          {
            features.push_back(salReg.salFeatures[j]);
            LDEBUG("[%4d]:%7f", j, salReg.salFeatures[j]);
          }

        Point2D<int> salpt(salReg.salpt.i, salReg.salpt.j);
        Point2D<int> offset( salReg.objRect.tl.i, salReg.objRect.tl.j);
        Rectangle rect = Rectangle::tlbrO
          (salReg.objRect.tl.j, salReg.objRect.tl.i,
           salReg.objRect.br.j, salReg.objRect.br.i);

        // create a visual object for the salient region
        Image<PixRGB<byte> > objImg = crop(itsInputImage, rect);

        std::string testRunFPrefix("testRunFPrefix");
        std::string iname("iname");
        std::string saveFilePath("saveFilePath");

        std::string
          iName(sformat("%s_SAL_%07d_%02d",
                        testRunFPrefix.c_str(), currRequestID, i));
        std::string ifName = iName + std::string(".png");
        ifName = saveFilePath + ifName;
        rutz::shared_ptr<VisualObject>
          vo(new VisualObject
             (iName, ifName, objImg, salpt - offset, features,
              std::vector< rutz::shared_ptr<Keypoint> >(), false, false));
        itsInputVO.push_back(vo);
        itsVOKeypointsComputed.push_back(false);
        itsInputObjOffset.push_back(offset);

        LDEBUG("[%d] image[%d]: %s sal:[%d,%d] offset:[%d,%d]",
               currRequestID, i, iName.c_str(),
               (salpt - offset).i, (salpt - offset).j,
               offset.i, offset.j);
      }
    its_input_info_mutex.unlock();

    its_results_mutex.lock();
    itsMatchFound.clear();
    itsVOmatch.clear();         itsVOmatch.resize(inputSize);
    itsLmkMatch.clear();        itsLmkMatch.resize(inputSize);
    itsSegNumMatch.clear();     itsSegNumMatch.resize(inputSize);
    itsLenTravMatch.clear();    itsLenTravMatch.resize(inputSize);
    itsNumObjectSearch.clear(); itsNumObjectSearch.resize(inputSize);
    for(uint i = 0; i < inputSize; i++) itsMatchFound.push_back(false);
    for(uint i = 0; i < inputSize; i++) itsNumObjectSearch[i] = 0;
    itsNumJobsProcessed = 0;
    its_results_mutex.unlock();

    // fill the job queue
    its_job_queue_mutex.lock();
    itsJobQueue.clear();
    uint njobs = lsqMsg->jobs.size();
    for(uint i = 0; i < njobs; i++)
      {
        BeobotEvents::LandmarkSearchJob tempJob = lsqMsg->jobs[i];
        itsJobQueue.push_back
          (GSlocJobData(tempJob.inputSalRegID,
                        tempJob.dbSegNum,
                        tempJob.dbLmkNum,
                        tempJob.dbVOStart,
                        tempJob.dbVOEnd));
      }

    // print the job queue
    std::list<GSlocJobData>::iterator itr = itsJobQueue.begin();
    uint count = 0;
    while (itr != itsJobQueue.end())
      {
        LDEBUG("[%5d] match obj[%d] lDB[%3d][%3d]:[%3d,%3d]", count,
               (*itr).objNum, (*itr).segNum, (*itr).lmkNum,
               (*itr).voStartNum,(*itr).voEndNum);
        itr++; count++;
      }
    its_job_queue_mutex.unlock();
  }

  // Got a landmark match results - stop searching for that salient region
  else if(eMsg->ice_isA("::BeobotEvents::LandmarkMatchResultMessage"))
  {
    BeobotEvents::LandmarkMatchResultMessagePtr lmrMsg =
      BeobotEvents::LandmarkMatchResultMessagePtr::dynamicCast(eMsg);

    //Get the current request ID
    //int currRequestID = gistSalMsg->RequestID;

    BeobotEvents::LandmarkSearchJob tempJob = lmrMsg->matchInfo;
    LINFO("Got an lmrMessage");

    LINFO("LMR -> found match[%d]: with itsLandmarkDB[%d][%d]",
          tempJob.inputSalRegID, tempJob.dbSegNum, tempJob.dbLmkNum);

    its_results_mutex.lock();
    if(!itsMatchFound[tempJob.inputSalRegID])
      {
        itsMatchFound[tempJob.inputSalRegID]   = true;
        itsSegNumMatch[tempJob.inputSalRegID]  = lmrMsg->segNumMatch;
        itsLenTravMatch[tempJob.inputSalRegID] = lmrMsg->lenTravMatch;
      }
    its_results_mutex.unlock();
  }

  else if(eMsg->ice_isA("::BeobotEvents::CancelSearchMessage"))
    {
      its_job_queue_mutex.lock();
      itsEmptyQueue = true;
      its_job_queue_mutex.unlock();

      its_results_mutex.lock();
      LINFO("CancelSearchMessage: %d processed here", itsNumJobsProcessed);
      its_results_mutex.unlock();
    }
}