亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? aflock.cpp

?? FreeWRLduneInputDevice和FreeWRL一起可以讓用戶用帶有6DoF的輸入設(shè)備檢索3D VRML/X3D數(shù)據(jù)。它基于FreeWRL的"/tmp/inpdev"擴展傳感器輸入接口和w
?? CPP
?? 第 1 頁 / 共 3 頁
字號:
      /* POSIX (according to Zlotnick's book) tcsetattr returns zero if	 it performs *any* of the requested operations.  This means it	 can report `success' when it has actually failed to perform	 some proper subset of the requested operations.  To detect	 this partial failure, get the current terminal attributes and	 compare them to the requested ones.  */      /* Initialize to all zeroes so there is no risk memcmp will report a	 spurious difference in an uninitialized portion of the structure.  */      memset (&new_mode, 0, sizeof (new_mode));      if (tcgetattr (portId, &new_mode))         perror(serialPort);      /* Normally, one shouldn't use memcmp to compare structures that	 may have `holes' containing uninitialized data, but we have been	 careful to initialize the storage of these two variables to all	 zeroes.  One might think it more efficient simply to compare the	 modified fields, but that would require enumerating those fields --	 and not all systems have the same fields in this structure.  */      if (memcmp (&termIoPort, &new_mode, sizeof (termIoPort)) != 0)	{#ifdef CIBAUD	  /* SunOS 4.1.3 (at least) has the problem that after this sequence,	     tcgetattr (&m1); tcsetattr (&m1); tcgetattr (&m2);	     sometimes (m1 != m2).  The only difference is in the four bits	     of the c_cflag field corresponding to the baud rate.  To save	     Sun users a little confusion, don't report an error if this	     happens.  But suppress the error only if we haven't tried to	     set the baud rate explicitly -- otherwise we'd never give an	     error for a true failure to set the baud rate.  */	  new_mode.c_cflag &= (~CIBAUD);	  if (memcmp (&termIoPort, &new_mode, sizeof (termIoPort)) != 0)#endif	      fprintf(stderr,		     " unable to perform all requested operations %s",		     serialPort);#else    /* set Ascension FOB port parameters */    termIoPort.c_ospeed = magicBaudRate;	/* out */    termIoPort.c_ispeed = magicBaudRate;	/* in : not supported                                                    (in = out) */    if ((ioctl(portId, TCSETA, &termIoPort)) == -1) {	fprintf(stderr, "Error setting attributes for serial port %s:\n",                 serialPort);#ifdef HAVE_OSERROR	fprintf(stderr,"oserror %d\n",oserror());#endif        perror(serialPort);#endif    }   char command[1024];#ifdef USE_STTY_LINUX// when termios do not work 8-(   snprintf(command,1023,"stty 38400 cs8 cread clocal min 0 time 1 -F /dev/ttyS%c",            serialPort[strlen(serialPort)-1]);   system(command);#endif#ifdef HAVE_AFLOCK_DEBUG   // only used for debugging    // run "stty -a #  ifdef __sgi   snprintf(command,1023,"stty -a F /dev/ttyd%c",            serialPort[strlen(serialPort)-1]);#  else   snprintf(command,1023,"stty -a F /dev/ttyS%c",            serialPort[strlen(serialPort)-1]);#  endif   system(command);#endif    // return the portID    return portId;}void Aflock::set_blocking( const int& port, const int& blocking ){    //////////////////////////////////////////////////////////////////    // Setup a non/blocked port & Flush port    //////////////////////////////////////////////////////////////////    static int blockf,nonblock;    int flags;    flags = fcntl( port,F_GETFL,0 );    // Turn blocking on    blockf   = flags & ~FNDELAY;    // Turn blocking off    nonblock = flags | FNDELAY;    // 0 Non Blocked    // 1 Blocked    fcntl( port, F_SETFL, blocking ? blockf : nonblock );    usleep( 1000 * Aflock::mSleepFactor );//    tcflush(port, TCIOFLUSH);}void Aflock::set_sync( const int& port, const int& sync ){    /////////////////////////////////////////////////////////////////    // Set CRT sync: (manual page 82)    //   set crt sync    //   nosync    -   0    //   > 72Hz    -   1 (type 1)    //                 2 (type 2)    /////////////////////////////////////////////////////////////////    unsigned char buff[4] = {'A', 1};    buff[1] = sync;    write( port,buff,2 );    tcdrain(port);}void Aflock::set_hemisphere( const int& port,			const BIRD_HEMI& hem,			const int& transmitter ){    /////////////////////////////////////////////////////////////////    // Set Hemisphere for birds taking input    //    //  buff   [1]   [2]    // Front: 0x00, 0x00    // Aft  : 0x00, 0x01    // Upper: 0x0C, 0x01    // Lower: 0x0C, 0x00    // Left : 0x06, 0x01    // Right: 0x06, 0x00    /////////////////////////////////////////////////////////////////    char buff[3];    buff[0] = 'L';    for (int i = 1; i <= getNumberDevices(); i++)    {	if (!deliverData(i))  	    continue;	pickBird( i,port );	switch (hem)	{	case FRONT_HEM:	    buff[1] = 0x00;	    buff[2] = 0x00;	    break;	case AFT_HEM:	    buff[1] = 0x00;	    buff[2] = 0x01;	    break;	case UPPER_HEM:	    buff[1] = 0x0C;	    buff[2] = 0x01;	    break;	case LOWER_HEM:	    buff[1] = 0x0C;	    buff[2] = 0x00;	    break;			case LEFT_HEM:	    buff[1] = 0x06;	    buff[2] = 0x01;	    break;	case RIGHT_HEM:	    buff[1] = 0x06;	    buff[2] = 0x00;	    break;	}	write( port, buff, 3 );	usleep( 500 * Aflock::mSleepFactor );        tcdrain(port);    }}// Streaming mode currently not usedvoid Aflock::set_rep_and_stream(const int& port, const char& reportRate){    char buff[1];    /////////////////////////////////////////////////////////////////    // Set report rate    //             Q  Every cycle    //  buff[0] - 'R' Every other bird cycle    //             S  every 8 cycles    //             T  every 32 cycles    /////////////////////////////////////////////////////////////////    buff[0] = reportRate;    write( port, buff, 1 );    usleep( 2000 * Aflock::mSleepFactor );    tcdrain(port);    ////////////////////////////////////////////////////////////////    // set stream mode    ////////////////////////////////////////////////////////////////    buff[0] = '@';    write( port, buff, 1 );    usleep( 500 * Aflock::mSleepFactor );    tcdrain(port);}void Aflock::set_pos_quat(const int& port, const int& transmitter){    //////////////////////////////////////////////////////////////////    // Set Position Quaternion    /////////////////////////////////////////////////////////////////    char buff[1];    for (int i = 1; i <= getNumberDevices(); i++)    {	if (!deliverData(i))		continue;	Aflock::pickBird( i,port );	buff[0] = ']';	write( port, buff, 1 );	usleep( 500 * Aflock::mSleepFactor );        tcdrain(port);      AFLOCK_ERROR_CHECK(port,"Position/Quaternion command",transmitter);    }}void Aflock::set_pos_angles(const int& port, const int& transmitter){    //////////////////////////////////////////////////////////////////    // Set Position Angles    /////////////////////////////////////////////////////////////////    char buff[1];    for (int i = 1; i <= getNumberDevices(); i++)    {	if (!deliverData(i))		continue;	Aflock::pickBird( i,port );	buff[0] = 'Y';	write( port, buff, 1 );	usleep( 500 * Aflock::mSleepFactor );        tcdrain(port);      AFLOCK_ERROR_CHECK(port,"Position/Angles command",transmitter);    }}void Aflock::set_filter(const int& port, const BIRD_FILT& filter){    // a filter value of AC_NARROW | AC_WIDE | DC_FILTER     // turns all filters on    ///////////////////////////////////////////////////////////////    // Turn filters on (manual page 48)    // 0s turn AC NARROW notch filter ON    //         AC WIDE notch filter ON    //         DC filter ON    ///////////////////////////////////////////////////////////////    for (int i = 1; i <= getNumberDevices(); i++)    {       if (!deliverData(i))          continue;       pickBird( i,port );       char buff[4];       buff[0] = 'P';       buff[1] = (~filter) & 7;       buff[2] = 0x00;       buff[3] = 0;       write(port, buff, 4);       //TODO: Do I need to sleep here?       usleep(12000 * Aflock::mSleepFactor);       tcdrain(port);    }}void Aflock::set_transmitter(const int& port, const int& transmitter){    ///////////////////////////////////////////////////////////////    // Sets up the device for Transmitting (manual page 67)    // Command (0x30) for Next Transmitter    ///////////////////////////////////////////////////////////////    char buff[2];    buff[0] = (unsigned char) (0x30);    buff[1] = (unsigned char) transmitter  << 4;    write(port, buff, 2);    usleep(12000 * Aflock::mSleepFactor);    tcdrain(port);}void Aflock::set_autoconfig(const int& port){    ///////////////////////////////////////////////////////////////    // FBB AUTO-CONFIGURATION (manual page 60)    //    // Must wait 300 milliseconds before and after this command    ///////////////////////////////////////////////////////////////    pickBird(1,port);    sleep(1);    char buff[3];    buff[0] = 'P';    buff[1] = 0x32;    buff[2] = getNumberDevices();    write(port, buff,3);    sleep(1);    tcdrain(port);    int i=0;#ifdef HAVE_AFLOCK_DEBUG    pickBird(1,port);    buff[0] = 'O';    buff[1] = 0x32;    write(port, buff,2);    tcdrain(port);    // TODO: we should know here, what's the current adressing mode         sleep(1);    // we are in normal adressing mode, autoconfig command will return 5 byte    const int infolength=5;    char info[infolength];    int numbytes;    do {       numbytes=read(port, info, infolength-i);       if (numbytes<=0)          {          fprintf(stderr,"Aflock: cant get 5 bytes from autoconfig command:");          fprintf(stderr,"Aflock running in normal mode ?\n");          fprintf(stderr,"aflock: got %d bytes instead of 5\n",i);          break;          }       } while ((i+=numbytes)<infolength);    if (i==5)        {       if (info[0]==0)          fprintf(stderr,"Aflock: in standalone mode\n");       else if (info[0]==1)          fprintf(stderr,"Aflock: in transmitter/multiple sensors mode\n");       else          fprintf(stderr,"Aflock: unexpected returnvalue from auto-config\n");       for (i=1;i<8;i++)          if ( (info[1]&&(1<<i)) == 0)             fprintf(stderr,"Aflock: device %d not running\n",i);          else             fprintf(stderr,"Aflock: device %d is running\n",i);       for (i=0;i<7;i++)          if ( (info[2]&&(1<<i)) == 0)             fprintf(stderr,"Aflock: device %d not running\n",i+8);          else             fprintf(stderr,"Aflock: device %d is running\n",i+8);       }sleep(1);#endif}/// not used void Aflock::set_group(const int& port){    ////////////////////////////////////////////////////////////////    // Setup group mode: (manual page 59)    // 'P' Change Parameter    // Number 35 (hex 23),    // Set flag to 1 enabling group mode.    ////////////////////////////////////////////////////////////////    char buff[3];    buff[0] = 'P';    buff[1] = 0x23;    buff[2] = 0x01;    write(port, buff, 3);    tcdrain(port);    sleep(2);}void Aflock::set_sudden_output_change_lock(const int& port,bool lock){    ////////////////////////////////////////////////////////////////    // Set sudden output mode: (manual page ?)    // 'P' Change Parameter    // Number 14 (hex 0e),    // Set flag to 1/0 to lock/unlock sudden output change    ////////////////////////////////////////////////////////////////    for (int i = 1; i <= getNumberDevices(); i++)    {       if (!deliverData(i))          continue;       pickBird( i,port );       char buff[3];       buff[0] = 'P';       buff[1] = 0x0e;       if (lock)          buff[2] = 0x01;       else          buff[2] = 0x00;       write(port, buff, 3);       sleep(1);       tcdrain(port);    }}#else// dummy function, cause some compilers do not like empty inputfiles....static void Aflock_dummy(void) {}#endif

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品一级片在线观看| 精品一区二区在线免费观看| 日韩一区二区在线播放| 国产激情91久久精品导航| 亚洲欧美国产高清| 日韩视频在线观看一区二区| 91在线一区二区| 久久99精品国产麻豆婷婷| 亚洲日本成人在线观看| 精品国产91九色蝌蚪| 91福利在线导航| 成人av网站在线观看| 精品一区二区在线视频| 亚洲国产精品一区二区尤物区| 久久九九影视网| 一本大道综合伊人精品热热| 精品一区二区精品| 日欧美一区二区| 亚洲精品国产视频| 国产精品激情偷乱一区二区∴| 欧美成人猛片aaaaaaa| 欧美色欧美亚洲另类二区| 成人黄色一级视频| 国产乱国产乱300精品| 久久国产人妖系列| 日韩在线a电影| 亚洲一区二区三区不卡国产欧美| **网站欧美大片在线观看| 国产区在线观看成人精品| 日韩一级欧美一级| 69精品人人人人| 欧美日韩一区视频| 欧美日韩综合不卡| 欧美中文字幕亚洲一区二区va在线 | 蜜桃久久久久久久| 午夜精品一区在线观看| 亚洲国产裸拍裸体视频在线观看乱了| 中文字幕中文字幕在线一区| 蜜臀av一区二区在线免费观看| 一区二区三区不卡视频在线观看| 国产精品久久久久久妇女6080| 欧美mv日韩mv国产网站app| 欧美日韩亚洲不卡| 色婷婷精品久久二区二区蜜臂av| 色狠狠色噜噜噜综合网| 99综合电影在线视频| av欧美精品.com| 国产一区二区三区四区五区美女 | 91丨九色丨尤物| 成人av动漫在线| av在线综合网| 国产麻豆视频一区二区| 精品亚洲欧美一区| 丝袜诱惑制服诱惑色一区在线观看 | 久久久亚洲精华液精华液精华液 | 欧美系列亚洲系列| 欧洲精品一区二区三区在线观看| 日韩av中文在线观看| 国产呦萝稀缺另类资源| 国产一区二区三区在线观看免费视频 | 成人免费一区二区三区视频| 国产欧美精品一区| 自拍偷拍国产亚洲| 亚洲一线二线三线视频| 视频一区二区三区在线| 亚洲一区日韩精品中文字幕| 成人欧美一区二区三区| 偷窥少妇高潮呻吟av久久免费| 亚洲成a人v欧美综合天堂下载| 久久精品噜噜噜成人av农村| 久久精品国产免费| 波多野结衣在线aⅴ中文字幕不卡| 99精品视频免费在线观看| 欧美无砖砖区免费| 91超碰这里只有精品国产| 精品日韩在线观看| 中文字幕免费不卡在线| 亚洲午夜激情av| 日韩精品欧美精品| 国产精品1区2区| 成人av先锋影音| 国产aⅴ综合色| 91福利国产精品| 日韩欧美一级二级三级久久久| 国产亚洲短视频| 1024亚洲合集| 捆绑紧缚一区二区三区视频| 国产成人av影院| 制服丝袜av成人在线看| 欧美精品一区男女天堂| 一区二区三区四区亚洲| 免费看日韩a级影片| 91麻豆精品在线观看| 7777精品伊人久久久大香线蕉最新版| 国产精品入口麻豆原神| 一区二区三区四区中文字幕| 国内精品国产成人国产三级粉色| 99在线精品视频| 久久综合色鬼综合色| 1000精品久久久久久久久| 精品亚洲porn| 在线观看一区二区精品视频| 国产日韩欧美精品在线| 亚洲亚洲精品在线观看| 成人一级片在线观看| 91 com成人网| 国产亚洲污的网站| 麻豆国产一区二区| 色爱区综合激月婷婷| 亚洲国产精品二十页| 午夜伊人狠狠久久| 色丁香久综合在线久综合在线观看| 日韩一区和二区| 午夜视频在线观看一区二区三区| 国产一区二区视频在线播放| 欧美一区二区三区人| 自拍视频在线观看一区二区| 麻豆精品在线看| 欧洲av一区二区嗯嗯嗯啊| 日本一区二区高清| 午夜欧美电影在线观看| 成人av影视在线观看| 精品国产乱码久久久久久老虎| 亚洲一卡二卡三卡四卡| 99久久精品国产毛片| 中文字幕成人在线观看| 麻豆精品精品国产自在97香蕉| 欧美日本视频在线| 一区二区三区不卡在线观看| 91在线观看污| 国产午夜三级一区二区三| 国产真实乱子伦精品视频| 制服丝袜中文字幕一区| 婷婷开心激情综合| 91极品美女在线| 亚洲欧美激情小说另类| 97se狠狠狠综合亚洲狠狠| 国产精品美日韩| 国产福利一区在线| 久久久国产精品不卡| 国模套图日韩精品一区二区| 7777精品伊人久久久大香线蕉超级流畅| 一区二区三区高清在线| 欧美国产精品一区| 9久草视频在线视频精品| 欧美国产综合色视频| 不卡的电影网站| 国产精品乱码一区二区三区软件| 成人免费毛片aaaaa**| 中文字幕不卡的av| 色哟哟一区二区在线观看| 亚洲色图另类专区| 欧美日韩一区 二区 三区 久久精品| 最新久久zyz资源站| 在线观看视频91| 亚洲综合一区二区精品导航| 91免费看`日韩一区二区| 久久嫩草精品久久久久| 国产资源在线一区| 国产日韩欧美不卡在线| 国产一区二区视频在线播放| 中文字幕精品—区二区四季| 一本色道亚洲精品aⅴ| 樱花影视一区二区| 91超碰这里只有精品国产| 美女视频免费一区| 国产午夜一区二区三区| 成人动漫一区二区| 亚洲第一精品在线| 91精品一区二区三区在线观看| 极品瑜伽女神91| 色综合久久综合| 欧美丰满少妇xxxxx高潮对白| 日韩毛片一二三区| 成人精品视频.| 在线亚洲精品福利网址导航| 日韩一区中文字幕| 欧美视频在线观看一区| 国产精品网站在线| 国产电影一区在线| 91麻豆产精品久久久久久| 亚洲第一主播视频| 777午夜精品免费视频| 亚洲人成电影网站色mp4| 美腿丝袜亚洲三区| 久久精品视频一区二区三区| 一区二区三区在线播放| 麻豆精品蜜桃视频网站| 成人免费毛片嘿嘿连载视频| 91精品午夜视频| 欧美岛国在线观看| 亚洲国产成人91porn| 99精品视频在线观看| 欧美色视频在线观看| 欧美一级在线视频| 7777女厕盗摄久久久| 日本成人在线一区| 69久久夜色精品国产69蝌蚪网| 欧美日韩一级视频| 亚洲男人天堂一区|