Exemplo n.º 1
0
RfidReaderMac::RfidReaderMac(NodePtr node, RfidReaderAppPtr readerApp)
	: SlottedMac(node), 
	m_doResetSlot(false), m_resetSlotNumber(0),
	m_doEntireReadCycle(false), m_missedReadCount(0),
	m_nextCycleNumberOfSlots(m_DEFAULT_NUMBER_OF_SLOTS),
	m_nextCycleTime(m_DEFAULT_CYCLE_TIME), m_readerApp(readerApp)
{
	setSlotTime(SimTime(m_DEFAULT_SLOT_TIME));
}
Exemplo n.º 2
0
void TextEdit::onPreRender()
{
   bool focused =  (root->getFirstResponder() == this);

   if(focused)
   {
      SimTime timeElapsed = manager->getCurrentTime() - timeLastCursorFlipped;
      numFramesElapsed++;
      if ((timeElapsed > SimTime(0.5f)) && (numFramesElapsed > 3) )
      {
         cursorOn = 1 - cursorOn;
         timeLastCursorFlipped = manager->getCurrentTime();   
         numFramesElapsed = 0;
         setUpdate();
      }
   }
}    
Exemplo n.º 3
0
bool RfidReaderMac::isEnoughTimeForContentionCycle() const
{
	// We need one extra slot be cycle to send the REQUEST
	// packet.
	double nextContentionCycleTime = 
	(m_nextCycleNumberOfSlots + 1) * m_DEFAULT_SLOT_TIME;

	if(m_DEBUG_CONTENTION_CYCLE_TIME) {
		SimTime timeRemaining = m_cycleTimer->timeRemaining();
		if(timeRemaining > 0.0) {
			ostringstream debugStream;
			debugStream << __PRETTY_FUNCTION__ <<
			" nextCycleTime=" << nextContentionCycleTime <<
			", readCycleRemaining=" << timeRemaining;
			LogStreamManager::instance()->logDebugItem(
				debugStream.str());
		}
	}

	return (SimTime(nextContentionCycleTime) < 
			m_cycleTimer->timeRemaining());
}