• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ processCommand函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中processCommand函数的典型用法代码示例。如果您正苦于以下问题:C++ processCommand函数的具体用法?C++ processCommand怎么用?C++ processCommand使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了processCommand函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: ctsimtext_main

int
ctsimtext_main (int argc, char * argv[])
{
  int iReturn = 0;

  if (argc > 1 && (strcmp(s_szProgramName, fileBasename (argv[0])) == 0 || strcmp(s_szProgramName2, fileBasename (argv[0])) == 0 || strcmp(s_szProgramName3, fileBasename (argv[0])) == 0)) {
    argv++;
    argc--;
    iReturn = processCommand (argc, argv);
  } else if (argc >= 1 && ! (strcmp(s_szProgramName, fileBasename (argv[0])) == 0 || strcmp(s_szProgramName2, fileBasename (argv[0])) == 0 || strcmp(s_szProgramName3, fileBasename (argv[0])) == 0)) {
    iReturn = processCommand (argc, argv);
  } else {
    s_bInteractive = true;
    char szPrompt[] = "CTSim> ";
    std::cout << "CTSim Text Shell";
#ifdef VERSION
    std::cout << ", Version " << VERSION;
#endif
    std::cout << " (Type \"quit\" to end)\n\n";

    while (1) {
#ifdef HAVE_READLINE
      char* pszInputLine = readline (szPrompt);
      if (! pszInputLine)
        break;
      if (*pszInputLine != EOS)
        add_history (pszInputLine);

#else  // DONT_HAVE_READLINE

      static const int s_MaxLineLength = 1024;
      char* pszInputLine = new char [s_MaxLineLength+1];
      std::cout << szPrompt;
      std::cin.getline (pszInputLine, s_MaxLineLength);

#ifdef DEBUG
      std::cout << "#" << pszInputLine << "#\n";
#endif

      std::cout << std::flush;
      std::cout << "\n";
#endif  // DONT_HAVE_READLINE

      if (strncasecmp (pszInputLine, "quit", 4) == 0)
        break;

      convertStringToArgcv (pszInputLine, &argc, &argv);
#ifdef DEBUG
      for (int i = 0; i < argc; i++)
        std::cout << "Token " << i << ": " << argv[i] << "\n";
#endif
      iReturn = processCommand (argc, argv);

      delete pszInputLine;
    }
  }

  return iReturn;
}
开发者ID:leila1349,项目名称:OPT_recon,代码行数:59,代码来源:ctsimtext.cpp


示例2: main

void main (void)
{
	DDRB = 0xff;
	PORTB = 0;

	initUart(9600, 0);

#ifdef DEBUG
	printHelp(NULL);
#endif

	// initialize the 16-bit timer
	TCCR1A = _BV(COM1A1);
	TCCR1B |= TIMER1_CLOCKSOURCE;
	TIMSK = _BV (TOIE1);

	memset(info, 0, sizeof(struct LED_INFO) * 8);

	process = force = 0;

	sei ();
	while(1)
	{
		if(UCSRA & (1 << RXC))
			processCommand();
	}
}
开发者ID:OneLessHam,项目名称:avr_stuff,代码行数:27,代码来源:simple_pwm.c


示例3: main

int main(int argc, char** argv){
    GraphDiscription modelJets, bunchGraph, graphTemplate;
    ImageList *modelImages, *novelImages;
    JetMasks masks;
    Arguments args;

    srand(time(NULL));

    processCommand(argc, argv, &args);

    /* build masks */
    masks = readMasksFile(args.masksFile);
    modelImages = getImageNames(args.modelFile, NULL);
    novelImages = getImageNames(args.novelFile, NULL);
    graphTemplate = readGraphDiscription(makePath(args.graphDir,modelImages->filename));

    /* extract model jets */
    modelJets = extractModelJets(modelImages, args.imageDir, args.graphDir, masks);

    /* build jet bunch */
    /* bunchGraph = buildBunchGraph(modelJets, args.distance, args.bunchSize); */
    bunchGraph = modelJets;

    /* locate features in novel image */
    locateNovelFeatures(novelImages, graphTemplate, bunchGraph, masks, args.imageDir, args.outputDir, args.dispEst);

    return 0;
}
开发者ID:MBrauna,项目名称:Biometria,代码行数:28,代码来源:csuEBGMGraphFit.c


示例4: while

bool MeetAndroid::receive(){
	uint8_t lastByte;
	boolean timeout = false;
	while(!timeout)
	{
		while(Serial.available() > 0)
		{
			lastByte = Serial.read();
			
			if(lastByte == abord){
				flush();
			}
			else if(lastByte == ack){
				processCommand();
				flush();
			}
			else if(bufferCount < ByteBufferLenght){
				buffer[bufferCount] = lastByte;
				bufferCount++;
			}
			else return false;
		}
		
		if(Serial.available() <= 0 && !timeout){
			if(waitTime > 0) delayMicroseconds(waitTime);
			if(Serial.available() <= 0) timeout = true;
		}
	}
	return timeout;
}
开发者ID:9thSenseRobotics,项目名称:telo_arduino,代码行数:30,代码来源:MeetAndroid.cpp


示例5: usart_gogo

/*usart code*/
void usart_gogo(){
	if(checkUSARTflag_up()){
		usart_data = receiveByte_up();
		usart_data &= 0x3F;	//Maska ut kommandot 
		processCommand(usart_data);
	}
}
开发者ID:mikaelangman,项目名称:grupp2robot,代码行数:8,代码来源:mimer.c


示例6: main

int main( void ) {
	// initalise UART
	uart_init( UART_BAUD_RATE );
	
	statusLed_init( );
	
	// flash status LED for a bit
	statusLed_orange( );
	delay_ms( 500 );
	statusLed_green( );
	
	// uart_getc should block until data received
	uart_setBlocking( true );
	
	while ( 1 ) {
		// main loop of the programmer
		
		if ( uart_hasData( ) ) {
			unsigned char cmd = uart_getc( );
			
			processCommand( cmd );
		}
	}

	return 0;
}
开发者ID:theojulienne,项目名称:penguino-projects,代码行数:26,代码来源:avrisp.c


示例7: while

std::string Transaction::processLine(const std::string& line) {
	const char* delims = " \t";
	bool last = false;
	// TODO Handle quotes. Double and single per bash?
	std::string::size_type pos = line.find_first_not_of(delims);
	if (pos == std::string::npos) {
		// Whitespace only.
		return "";
	}
	vector<std::string> args;
	while (!last) {
		std::string::size_type nextPos = line.find_first_of(delims, pos);
		if (nextPos == std::string::npos) {
			nextPos = line.length();
			last = true;
		}
		std::string part = line.substr(pos, nextPos - pos);
		args.push_back(part);
		if (!last) {
			pos = line.find_first_not_of(delims, nextPos);
			if (pos == std::string::npos) {
				last = true;
			}
		}
	}
	return processCommand(args);
}
开发者ID:BGCX261,项目名称:zofiri-hg-to-git,代码行数:27,代码来源:pub.cpp


示例8: SCPI_Parse

/**
 * Parse one command line
 * @param context
 * @param data - complete command line
 * @param len - command line length
 * @return 1 if the last evaluated command was found
 */
int SCPI_Parse(scpi_t * context, char * data, size_t len) {
    int result = 0;
    const char * cmdline_end = data + len;
    char * cmdline_ptr = data;
    size_t cmd_len;
    size_t cmdline_len;
    char * cmdline_ptr_prev = NULL;
    size_t cmd_len_prev = 0;

    if (context == NULL) {
        return -1;
    }

    while (cmdline_ptr < cmdline_end) {
        result = 0;
        cmd_len = cmdTerminatorPos(cmdline_ptr, cmdline_end - cmdline_ptr);
        if (cmd_len > 0) {
            composeCompoundCommand(cmdline_ptr_prev, cmd_len_prev,
                                    &cmdline_ptr, &cmd_len);
            cmdline_len = cmdlineSeparatorPos(cmdline_ptr, cmdline_end - cmdline_ptr);
            if(findCommand(context, cmdline_ptr, cmdline_len, cmd_len)) {
                processCommand(context);
                result = 1;
                cmdline_ptr_prev = cmdline_ptr;
                cmd_len_prev = cmd_len;
            } else {
                SCPI_ErrorPush(context, SCPI_ERROR_UNDEFINED_HEADER);
            }
        }
        cmdline_ptr += skipCmdLine(cmdline_ptr, cmdline_end - cmdline_ptr);
        cmdline_ptr += skipWhitespace(cmdline_ptr, cmdline_end - cmdline_ptr);
    }
    return result;
}
开发者ID:WCP52,项目名称:gpha,代码行数:41,代码来源:parser.c


示例9: appendFileMotionStats

int appendFileMotionStats(char * filename,struct motionStats *st,struct InputParserC * ipc,unsigned int startAtFrame)
{
 char line [512]={0};

 fprintf(stderr,"Opening file %s\n",filename);
 FILE * fp = fopen(filename,"r");
 if (fp == 0 ) { fprintf(stderr,"Cannot open stream %s \n",filename); return 0; }


   while (!feof(fp))
   {
   //We get a new line out of the file
   int readOpResult = (fgets(line,512,fp)!=0);
   if ( readOpResult != 0 )
    {
      //We tokenize it
      unsigned int words_count = InputParser_SeperateWords(ipc,line,0);
      if ( words_count > 0 )
         {
             processCommand(ipc,st,line,words_count,startAtFrame);
         } // End of line containing tokens
    } //End of getting a line while reading the file
  }


  fclose(fp);
  return 1;
}
开发者ID:AmmarkoV,项目名称:RGBDAcquisition,代码行数:28,代码来源:main.c


示例10: main

int main(int argc, char *argv[]) 
{
initialize();
getCommandLineArgs(argc, argv);
processCommand(stdin);	
return 0;
}
开发者ID:romaan,项目名称:uq-itee-assignment,代码行数:7,代码来源:qshell.c


示例11: QString

void Programmanalisator::ProgramEinladen(QTextDocument* dok)

{
    LBL_lin.clear();
    LBL_rep.clear();
    LBL_call.clear();
    int Nstr = dok->lineCount();

    for (int i=0; i<(dok->lineCount()); i++ ) {

        QString* Kadr= new QString(dok->findBlockByLineNumber(i).text());

        int Res = processCommand(Kadr, i);

        if (Res<0) {
            QString str1=tr("Ошибка: Строка: ")+QString::number(i); // ошибка - выдадим сообщение
            errorMessage(str1);
        } else if (Res>0) {
            i=LBL_lin[I1];
            qDebug()<<"linie"<<I1;
        }

        int progress=(int)(((i+1)*100)/Nstr);
        qDebug()<<progress<<"%";
        emit Progress(progress);
        delete Kadr;
    }

    emit fertig();
}
开发者ID:ra3xdh,项目名称:HeidCAM,代码行数:30,代码来源:programmanalisator.cpp


示例12: portTASK_FUNCTION

/*******************************************************************************
 * TzCtrl
 *
 * Task for receiving commands from Tracealyzer and for recorder diagnostics.
 *
 ******************************************************************************/
static portTASK_FUNCTION( TzCtrl, pvParameters )
{
	TracealyzerCommandType msg;
	int bytes = 0;

	while (1)
	{
		bytes = 0;
		TRC_STREAM_PORT_READ_DATA(&msg, sizeof(TracealyzerCommandType), &bytes);
		if (bytes != 0)
		{
			if (bytes == sizeof(TracealyzerCommandType))
			{
				if (isValidCommand(&msg))
				{
					processCommand(&msg); /* Start or Stop currently... */
				}
			}
		}

		do
		{
			bytes = 0;
			TRC_STREAM_PORT_PERIODIC_SEND_DATA(&bytes);
		}
		while (bytes != 0);

		CheckRecorderStatus();
		vTaskDelay(TRC_CTRL_TASK_DELAY);	/* 10ms */
	}
}
开发者ID:AlexShiLucky,项目名称:freertos,代码行数:37,代码来源:trcKernelPort.c


示例13: checkReceive

void checkReceive(char letter) {

    // Starts new received word when start character arrives
    if (letter == START) {
        rcvData.currentIndex = 0;
        rcvData.message[rcvData.currentIndex] = letter;
        rcvData.currentIndex++;
        return;
    }
    // More than 8 bytes without an end byte
    if (rcvData.currentIndex > 7) {
        rcvData.currentIndex = 0;
        return;
    }

    // Stores current letter in word
    rcvData.message[rcvData.currentIndex] = letter;

    // Indicates word has been properly assembled
    if (letter == END && rcvData.currentIndex == 7) {
        rcvData.currentIndex = 0;
        // Sends message out
        processCommand();
    }

    rcvData.currentIndex++;

}
开发者ID:skitty1213,项目名称:Motors,代码行数:28,代码来源:receive.c


示例14: memset

bool StreamBase::checkCommandQueue() {
  if ( sd >= 0 ) {
    CmdMsg msg;
    memset(&msg, 0, sizeof(msg));
    int nbytes = recvfrom(sd, &msg, sizeof(msg), MSG_DONTWAIT, 0, 0);
    if ( nbytes < 0 ) {
      if ( errno != EAGAIN ) {
        Error("recvfrom(), errno = %d, error = %s", errno, strerror(errno));
        return false;
      }
    }
    //else if ( (nbytes != sizeof(msg)) )
    //{
      //Error( "Partial message received, expected %d bytes, got %d", sizeof(msg), nbytes );
    //}
    else {
      Debug(2, "Message length is (%d)", nbytes);
      processCommand(&msg);
      return true;
    }
  } else {
    Warning("No sd in checkCommandQueue, comms not open?");
  }
  return false;
}
开发者ID:barrygolden,项目名称:zoneminder,代码行数:25,代码来源:zm_stream.cpp


示例15: SCPI_Parse

/**
 * Parse one command line
 * @param context
 * @param data - complete command line
 * @param len - command line length
 * @return 1 if the last evaluated command was found
 */
int SCPI_Parse(scpi_t * context, const char * data, size_t len) {
    int result = 0;
    const char * cmdline_end = data + len;
    const char * cmdline_ptr = data;
    size_t cmd_len;
    size_t cmdline_len;

    if (context == NULL) {
        return -1;
    }

	
    while (cmdline_ptr < cmdline_end) {
        result = 0;
        cmd_len = cmdTerminatorPos(cmdline_ptr, cmdline_end - cmdline_ptr);
        cmdline_len = cmdlineSeparatorPos(cmdline_ptr, cmdline_end - cmdline_ptr);
        if (cmd_len > 0) {
            if(findCommand(context, cmdline_ptr, cmdline_len, cmd_len)) {
                processCommand(context);
                result = 1;
            } else {
                SCPI_ErrorPush(context, SCPI_ERROR_UNDEFINED_HEADER);
            }
        }
        cmdline_ptr = cmdlineNext(cmdline_ptr, cmdline_end - cmdline_ptr);
    }
    return result;
}
开发者ID:Toussaic,项目名称:main,代码行数:35,代码来源:parser.c


示例16: loop

//---------------------------------------------------------------------
void loop()
{
    waitForIncomingConnection();
    
    while ( client_.connected() )
    {
        uint8_t cmd = 255;
        
        if ( checkTcpTimeout() )
        {
#ifdef DEBUG_SERIAL
            Serial.println( "ERROR: connection timeout!" );
#endif
            break;
        }
        
        cmd = getCommand();
        if ( cmd == COMMAND_INVALID_COMMAND )
        {
#ifdef DEBUG_SERIAL
            Serial.print( "ERROR: invalid command received: ");
            Serial.println( cmd );
#endif
            break;
        }
        
        processCommand( cmd );
    }
    terminateConnection();
}
开发者ID:BerndBaumann,项目名称:Arduino,代码行数:31,代码来源:main.cpp


示例17: readCommandFile

  int readCommandFile(const char *path)
  {
    DEBUGMSG("reading command file " << path);

    QFile file(QFile::decodeName(path));
    if (!file.open(QFile::ReadOnly))
    {
      std::cout << "invalid" << std::endl;
      return ERR_INVALID;
    }

    LogCache cache;
    QVector<char*> argv;
    QTextStream stream(&file);
    while (!stream.atEnd())
    {
      QString line = stream.readLine();
      if (line.isEmpty())
        continue;
      auto args = line.toUtf8().split(' ');
      argv.resize(args.size() + 1);

      int argc = 0;
      for (auto &arg : args)
        argv[argc++] = arg.data();
      argv[argc] = nullptr;

      processCommand(argc, argv.data(), &cache);
    }

    qDeleteAll(cache); // clean up cached files
    return 0;
  }
开发者ID:rndCombo,项目名称:contestants_code_BIBIFI,代码行数:33,代码来源:logappend.cpp


示例18: if

int CommandExecutor::executorReceive(char recvChar)
{
	if (recvChar == 27) // ESC -> delete current commandLine
	{
		recvCommand.clear();
		if (commandHandler.getVerboseMode() == VERBOSE)
		{
			commandOutput->printf("\r\n%s",commandHandler.getCommandPrompt().c_str());
			commandOutput->flush();
		}
	}
	else if (recvChar == commandHandler.getCommandEOL())
	{
		processCommand(recvCommand);
		recvCommand.clear();
	}
	else
	{
		if (isprint(recvChar))
		{
			recvCommand.cmdString += recvChar;
		}
	}
	return 0;
}
开发者ID:BorntraegerMarc,项目名称:SmingRTOS,代码行数:25,代码来源:CommandExecutor.cpp


示例19: frame

void AdminConnection::processNormalFrame()
{
  InputFrame::Ptr frame( new InputFrame(version,paddingfilter) );
  if (readFrame(frame)) {
    try {
      switch (frame->getType()) {
        case ftad_CommandDesc_Get:
          processDescribeCommand(frame);
          break;
        case ftad_CommandTypes_Get:
          processGetCommandTypes(frame);
          break;
        case ftad_Command:
          processCommand(frame);
          break;
        default:
          WARNING("AdminConnection: Discarded frame, not processed, was type %d", frame->getType());
          throw FrameException( fec_ProtocolError, "Did not understand that frame type.");
          break;
      }
    } catch ( FrameException& exception ) {
      // This might be overkill later, but now let's log it
      DEBUG( "AdminConnection caught FrameException : %s", exception.what() );
      sendFail( frame, exception.getErrorCode(), exception.getErrorMessage() );
    }
  } else {
    DEBUG("noFrame :(");
    // client closed
  }
}
开发者ID:glew,项目名称:tpserver-cpp,代码行数:30,代码来源:adminconnection.cpp


示例20: main

int  main(void){
    init();
    while(1){
        processCommand();
    }
    return 0;
}
开发者ID:eseawind,项目名称:MicoCNC,代码行数:7,代码来源:GCode.c



注:本文中的processCommand函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ processData函数代码示例发布时间:2022-05-30
下一篇:
C++ processBuffer函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap