void AirsideFollowMeCarInSim::GetNextCommand()
{
	SetAvailable(true);

	m_pServiceFlight = NULL;
	m_pMeetingPoint = NULL;
	m_pAbandonData = NULL;

	ReturnVehiclePool(NULL);
}
nsMsgSearchValidityTable::nsMsgSearchValidityTable() {
  // Set everything to be unavailable and disabled
  for (int i = 0; i < nsMsgSearchAttrib::kNumMsgSearchAttributes; i++)
    for (int j = 0; j < nsMsgSearchOp::kNumMsgSearchOperators; j++) {
      SetAvailable(i, j, false);
      SetEnabled(i, j, false);
      SetValidButNotShown(i, j, false);
    }
  m_numAvailAttribs =
      0;  // # of attributes marked with at least one available operator
  // assume default is Subject, which it is for mail and news search
  // it's not for LDAP, so we'll call SetDefaultAttrib()
  m_defaultAttrib = nsMsgSearchAttrib::Subject;
}
Esempio n. 3
0
ScreamerNode::ScreamerNode(int number)
{
	m_number			  =	number;

	m_state				  =	WAIT;
	m_renderstate   = REQ_BATCH;
	m_waitreply		  =	false;
	
	char buffer[64];
	sprintf(buffer,"%d",number+1);

	m_config			  =	options->ScreamerConfigDir + "LW3.cfg";
	m_job					  =	(options->CommandDirectory + "job") + buffer;
	m_ack					  =	(options->CommandDirectory + "ack") + buffer;

	m_start				  =	0;
	m_end					  =	0;
	m_step				  =	0;

	ClearFrames();

	SetAvailable(false);
}
Esempio n. 4
0
void ScreamerNode::Update(void)
{
	switch(m_state){
		case WAIT:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "wait";

				m_jobfile.close();

				SetAvailable(true);
			}else{
				if(ReadReply(WAIT) == true){
					m_waitreply = false;
				}
			}
		}break;

		case INIT:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "init";

				m_jobfile.close();

				SetAvailable(false);
			}else{
				if(ReadReply(INIT) == true){
					m_waitreply = false;
					m_state			= CONTENT;
				}
			}
		}break;

		case CONTENT:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);


				m_jobfile << "content " << m_contentdir << std::endl;

				m_jobfile.close();
			}else{
				if(ReadReply(CONTENT) == true){
					m_waitreply = false;
					m_state			= LOAD;
				}
			}
		}break;

		case LOAD:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "load" << std::endl << m_scenefile;

				m_jobfile.close();
			}else{
				if(ReadReply(LOAD) == true){
					m_waitreply	=	false;

					m_state			=	RENDERWAIT;
				}
			}
		}break;

		case RENDERWAIT:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "wait";

				m_jobfile.close();
			}else{
				if(ReadReply(WAIT) == true){
					switch(m_renderstate){
						case REQ_BATCH:{
							m_scene->RequestBatch(m_start,m_end,m_step);

							m_state				=	RENDER;
							m_renderstate = RENDERING;
	
							SetFrames();

							m_waitreply = false;

							if(m_start == SCENE_COMPLETE){
								SetAvailable(true);

								ClearScene();
								ClearFrames();

								m_state	= WAIT;
							}
						}break;

						case RENDERING:{
							m_scene->FrameComplete();
							scene_view->Update(m_scene->GetID());

							if(m_start >= m_end){
								m_renderstate = REQ_BATCH;
							}else{
								m_waitreply	= false;

								m_state	=	RENDER;

								m_start++;
							}
						}
					};
				}
			}
		}break;

		case RENDERPAUSE:{
			if(m_waitreply == false){
				m_waitreply = true;
			}else{
				m_waitreply = false;
			}
		}break;

		case RENDER:{
			if(m_waitreply == false){
				m_waitreply = true;

				m_jobfile.clear();
				m_jobfile.open(m_job.c_str(),std::ios::out);

				m_jobfile << "render " << m_start << " " << m_start << " " << m_step;

				m_jobfile.close();
			}else{

				if(ReadReply(RENDER) == true){
					m_waitreply	= false;
					m_state			= RENDERWAIT;
				}
			}
		}break;


	};

	screamer_view->Update(m_number);
}
Esempio n. 5
0
        void tTouchObserver::Update()
        {
            // Get touch status from IOInterface
            QVariant touch_present = m_rHal.IOInterface()->FeatureProperty(tHAL::ePF_Touchscreen, tHAL::eFP_Present);
            bool touch_detected = false;
            if (touch_present.isValid())
            {
                touch_detected = touch_present.toBool();
            }
            else
            {
                // Backup method of touch detection, doesn't seem to even work properly
                // Wouldn't we be better searching /dev/input/touch or something? (Nick 7/8/2014)
                QDir usbdir("/sys/bus/usb/devices/");

                // Detected by stepping through /sys/bus/usb/devices/<USBEnum>/product 
                // and searching for "touch" with "screen".
                if (usbdir.exists())
                {
                    usbdir.setFilter(QDir::Dirs | QDir::NoDotAndDotDot);
                    QStringList entries = usbdir.entryList();
                    for( QStringList::ConstIterator entry=entries.begin(); entry!=entries.end(); ++entry )
                    {
                        QString dirname= *entry;
                        QFile usbproduct(dirname + "/product");

                        if ( usbproduct.open(QIODevice::ReadOnly | QIODevice::Text ) )
                        {
                            QTextStream in(&usbproduct);
                            QString line(in.readLine());

                            while ( !(line.isNull()) )
                            {
                                if  (
                                    (line.contains("touch",  Qt::CaseInsensitive)) && 
                                    (line.contains("screen",  Qt::CaseInsensitive))
                                    )
                                {
                                    // break out of the while loop once we've found a touch device
                                    touch_detected = true;
                                    break;
                                }

                                line = in.readLine();
                            }
                            // break out of the for loop once we've found a touch device
                            if (touch_detected)
                            {
                                break;
                            }
                        }
                    }
                }
            }
            if (touch_detected)
            {
                SetAvailable(true);
            }
            else
            {
                SetAvailable(false);
            }
        }