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

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

?? birdcmds.c

?? 一個(gè)C語言寫的讀入位置跟蹤器數(shù)據(jù)的源程序
?? C
?? 第 1 頁 / 共 5 頁
字號:
/****************************************************************************
*****************************************************************************
    birdcmds        - Bird Command Routines

    written for:    Ascension Technology Corporation
		    PO Box 527
		    Burlington, Vermont  05402
		    802-655-7879

    by:             Jeff Finkelstein
		    802-985-2535


    Modification History:
	  10/18/90  jf - released
	  10/24/90  jf - modified trap for 1.00 in birdanglealign to be 0x7fff
	  11/12/90  jf - add new commands
	  11/29/90  jf - added 'Hit 'B' Key...' to checkdone
			 added the dislay of retrace count to display CRT
			 Pick Display
	  2/4/91    jf - added code to display the button value if enabled
		       - modified change/examine filter strings to reflect
			 Wide/Narrow Notch filters
		       - fixed negative angle bug in bird_referframe
	  2/20/91   jf - added initialization of factory test mode to
			 birdloadconfig
	  3/16/91   jf - added new selection for CRT Sync for Fast Vertical
			 retrace (> 70 Hz)
	  4/25/91   jf - added restoreconsole to exit() condition for UNIX
			 compatibility
	  4/29/91   jf - fixed bug in checkdone(), STREAM mode to assure
			 a TRUE return if a key is hit
	  9/17/91   jf - added new change and examine value commands
			 for the FBB
		    jf - added posk global for POSK36 and POSK72
	  10/18/91  jf - modified max measurement rate to 144 Hz
	  11/1/91   jf - added chg/exm alpha max and glitch checking
	  11/10/91  jf - changed 'glitch checking' to 'sudden output change'
	  11/18/91  jf - changed max CRT sync to 72 Hz
	  1/3/92    jf - fixed bug in shutting off button mode
	  2/25/92   jf - added showfbbconfig from cmdutil.c
	  3/23/92   jf - modified Alpha Min/Max to 7 word tables
	  4/7/92    jf - added data file streaming to all the orientation
			 modes
		    jf - modified operation of chg/exm Error Mask
		    jf - modified measurement rate const to 0.3 for
			 ROMs 3.28 and 4.11
	  4/20/92   mo - added new functions bird_quaternions(),
			 bird_posquaternions() ,fprintquaternions()
			 and printquaternions().
	  6/1/92    jf - updated examine value to reflect new status 
			 definitions
	  6/9/92    jf - removed save config from change and examine value
		    jf - added examine extended error code
	  12/22/92  jf - updated for CPU independence...high byte/low byte
			 order now handled at run time to be compatible
			 with Motorola and RISC CPUs
	  1/26/93   jf - removed individual pos/orient cmds and replaced
			 them with getsinglebirddata
	  2/23/93   jf - added ERC filter values and text strings
	  5/18/94   sw - added Normal/expanded address mode detection
			 for examine birdstatus
	  5/23/94   sw - added XYZ Reference frame change value / examine value 
		       - corrected errors in filter distance labels
	  12/20/94  sw - added routines to run error statistics.
	   5/11/95  sw - removed addressing mode check on examine value, unless
			 command will need that information.                         
	   6/6/95   sw - Placed \r into new printf statements to work with unix systems.

	   <<<< Copyright 1990 Ascension Technology Corporation >>>>
*****************************************************************************
****************************************************************************/
#include <stdio.h>          /* general I/O */
#include <math.h>           /* trig math funcs */
#include "asctech.h"        /* general definitions */
#include "compiler.h"       /* Compiler Specific Header */
#include "menu.h"           /* for menus */
#include "serial.h"         /* serial I/O */
#include "cmdutil.h"        /* command utilities */
#include "birdcmds.h"

/***********************
    Globals
***********************/

/*
    External Varibles
*/
extern FILE * datafilestream;
extern unsigned char displaymultidataflg;

/*
    Position Variable
*/
float posk;
float crystalfreq = DEFAULTCRYSTALFREQ;
float clockvalue = DEFAULTCLOCKVALUE;
short buttonvalue = 0;
unsigned char fbbgroupdataflg = FALSE;
short flocksize = 1;
unsigned char fbbsystemstatus[31];
short numfbbaddrs = 30;
short numfbbrcvrs;
unsigned data_ready_char = ',';

/*
  data returned
*/
short birddata[14];    /* holds the data from the BIRD for buttondata */

/************************
    Routines
************************/

/*
    getsinglebirddata   Get Data from a Single Bird

    Prototype in:       birdcmds.h

    Parameters Passed:  outputmode  - POINT,CONTINUOUS or STREAM
			datamode    - POS, ANGLE, POSANGLE..
			displayon   - 
			buttonmode  - current button mode, 0 if button
				      character is not appended to data,
				      1 if button character is appended

    Return Value:       TRUE if successful
			FALSE otherwise

    Remarks:            Displays current Bird Data in POINT, CONTINUOUS
			or STREAM mode
*/
int getsinglebirddata(outputmode, datamode, displayon, buttonmode)
short outputmode;
unsigned char datamode;
unsigned char displayon;
short buttonmode;
{
    unsigned char datasize;
    unsigned char posorientcmd;

    /*
       Set the for the number of WORDs (16 bits) and the
       Pos/Orientation Mode command
    */
    switch(datamode)
    {
	case POS:
	    datasize = 3;
	    posorientcmd = 'V';
	    break;

	case ANGLE:
	    datasize = 3;
	    posorientcmd = 'W';
	    break;

	case MATRIX:
	    datasize = 9;
	    posorientcmd = 'X';
	    break;

	case QUATER:
	    datasize = 4;
	    posorientcmd = 92;
	    break;

	case POSANGLE:
	    datasize = 6;
	    posorientcmd = 'Y';
	    break;

	case POSMATRIX:
	    datasize = 12;
	    posorientcmd = 'Z';
	    break;

	case POSQUATER:
	    datasize = 7;
	    posorientcmd = ']';
	    break;

	default:
	    printf("\n\r** ERROR ** illegal data mode in getbirddata\n\r");
	    return(FALSE);
    }


    /*
	Send the Mode Command (ie. POS, ANGLES...
    */
    if (send_serial_cmd(&posorientcmd,1) != 1)
	return(FALSE);

    /*
	Send the Stream command if in STREAM mode
    */
    if (outputmode == STREAM)
	if (send_serial_cmd((unsigned char *)"@",1) != 1)
	    return(FALSE);

    /*
	 Send the User a Prompt if in Point mode
    */
    if (outputmode == POINT)
	 printf ("\n\rHit the 'B' Key to read Bird data or any other key to Quit\n\r");

    /*
	Now read the data from the Bird
	storing the data in birddata[]
	check for done condition, keyboard hit while displaying the data
    */

    while (!check_done(outputmode))
    {
	/*
	    Get the data NOW
	*/
	if (!readbirddata(birddata,datasize,outputmode,buttonmode))
	    return(FALSE);

	/*
	    Display and File (if required) the Data Now
	*/
	if (!displaybirddata(birddata, datamode, buttonmode,
			displayon,0,datafilestream))
	    return(FALSE);
    }
    return(TRUE);
}

/*
    bird_anglealign     - Align the Bird User Specified Direction

    Prototype in:       birdcmds.h

    Parameters Passed:  void

    Return Value:       TRUE if successful
			FALSE otherwise

    Remarks:            prompts the user for Azimuth, Elevation and Roll of
			the User Direction and sends these values to the Bird
			to reorient the Birds direction
*/
int bird_anglealign()
{

    short i;                /* matrix pointer */
    unsigned char * cdataptr;        /* pointer to cdata */
    float tempfloat;        /* temporary float value */
    float angle[3];         /* angles input byte the user */
    static unsigned char cdata[] =   {'J',0,0,0,0,0,0,0,0,0,0,0,0}; /* cmd + 12 bytes */

    /*
	Get the 3 angles from the User
    */
    if (getangles("\n\rInput Azimuth, Elevation, and Roll angles from receiver\n\rto reference direction in degrees: ",&angle[0]) ==
ESC_SEL)
	return(FALSE);

    /*
	convert sines and cosines to configuration bytes in cdata[],
	constructing the command string as we go.
    */
    cdataptr = &cdata[1];           /* assign pointer to the first character
				       after the command character
				    */
    for (i = 0; i < 3; i++)
    {
	/*
	    calculate the sine of the angle and
	*/
	tempfloat = sin((double)(angle[i] * DTR));

	/*
	    convert to a word and store in cdata
	    NOTE: trap for sin(90)...since the bird
	    can only accept data from -1.000 to 0.99996 (0x8000 to 0x7fff)
	*/
	if (tempfloat < 0.99998)
	{
	    *cdataptr++ = (unsigned char) ((short) (tempfloat * FTW) & 0x0ff);
	    *cdataptr++ = (unsigned char) (((short) (tempfloat * FTW) & 0x0ff00) >> 8);
	}
	else
	{
	    *cdataptr++ = 0x0ff;
	    *cdataptr++ = 0x07f;
	}

	/*
	    calculate the cosine of the angle and
	*/
	tempfloat = cos((double)(angle[i] * DTR));

	/*
	    convert to a word and store in cdata
	    NOTE: trap for cos(0)...since the bird
	    can only accept data from -1.000 to 0.99996 (0x8000 to 0x7fff)
	*/
	if (tempfloat < 0.99998)
	{
	    *cdataptr++ = (unsigned char) ((short) (tempfloat * FTW) & 0x0ff);
	    *cdataptr++ = (unsigned char) (((short) (tempfloat * FTW) & 0x0ff00) >> 8);
	}
	else
	{
	    *cdataptr++ = 0x0ff;
	    *cdataptr++ = 0x07f;
	}
    }

    /*
	Send the Command
    */
    if (send_serial_cmd(cdata,13) != 13)
	return(FALSE);

    printf("Angle Alignment Data sent to the Bird\n\r");
    hitkeycontinue();

    return(TRUE);
}

/*
    bird_hemisphere     -   Set the Birds Hemisphere

    Prototype in:       birdcmds.h

    Parameters Passed:  void

    Return Value:       TRUE if successful
			FALSE if unsuccessful
			ESC_SEL if ESC selected

    Remarks:            prompt the user for the Bird hemisphere and send
			down coresponding hemisphere command to the Bird
*/
int bird_hemisphere()
{
    static char * hemisphere_menuptr[] = 
				  {"Hemisphere Options:",  /* menu options */
				   "Forward",
				   "Aft",
				   "Upper",
				   "Lower",
				   "Left",
				   "Right"};
    static unsigned char hemisphere_cdata[] = {'L',0,0};  /* command string 
							     to BIRD */

    /*
	Send the Menu to the User
    */
    switch (sendmenu(hemisphere_menuptr,6))
    {
	/*
	    Setup the Command string to the Bird as a function of the
	    User menu selection.....
	    .....2 data bytes must be set for HEMI_AXIS and HEMI_SIGN
	*/
	case 0: /* Forward */
	    hemisphere_cdata[1] = 0;       /* set XYZ character */
	    hemisphere_cdata[2] = 0;       /* set Sine character */
	    break;

	case 1: /* Aft */
	    hemisphere_cdata[1] = 0;       /* set XYZ character */
	    hemisphere_cdata[2] = 1;       /* set Sine character */
	    break;

	case 2: /* Upper */
	    hemisphere_cdata[1] = 0xc;     /* set XYZ character */
	    hemisphere_cdata[2] = 1;       /* set Sine character */
	    break;

	case 3: /* Lower */
	    hemisphere_cdata[1] = 0xc;     /* set XYZ character */
	    hemisphere_cdata[2] = 0;       /* set Sine character */
	    break;

	case 4: /* Left */
	    hemisphere_cdata[1] = 6;       /* set XYZ character */
	    hemisphere_cdata[2] = 1;       /* set Sine character */
	    break;

	case 5: /* Right */
	    hemisphere_cdata[1] = 6;       /* set XYZ character */
	    hemisphere_cdata[2] = 0;       /* set Sine character */
	    break;

	case ESC_SEL:
	    return(ESC_SEL);
    }
    /*
	Send the Command
    */
    if (send_serial_cmd(hemisphere_cdata,3) != 3)
	return(FALSE);

    printf("Hemisphere Data Sent to the Bird\n\r");
    hitkeycontinue();

    return(TRUE);
}

/*
    bird_referframe -   Define a new Bird Reference Frame

    Prototype in:       birdcmds.h

    Parameters Passed:  void

    Return Value:       TRUE if successful
			FALSE otherwise

    Remarks:
*/
int bird_referframe()
{
    static unsigned char referframe_cdata[] =
			{'H',0,0,0,0,0,0,0,0,0,0,0,0};  /* the cmd */
    unsigned char * cdataptr = &referframe_cdata[1];
    short i;
    float tempfloat;
    float angle[3];     /* holds the floating point angles */


    /*
	Get the user to input Azimuth, Elevation, and Roll
    */
    if (getangles("\n\rInput Azimuth, Elevation, and Roll angles\n\rof new reference frame: ",&angle[0]) == ESC_SEL)
	return(FALSE);

    /*
	Convert all angles and store in command string
    */
    for(i=0;i<3;i++)
    {
	/*
	    calculate the sine of the angle and
	*/
	tempfloat = sin((double)(angle[i] * DTR));

	/*
	    convert to a word and store in cdata
	    NOTE: trap for sin(90)...since the bird
	    can only accept data from -1.000 to 0.99996 (0x8000 to 0x7fff)
	*/
	if (tempfloat < 0.99998)
	{
	    *cdataptr++ = (unsigned char) ((short) (tempfloat * FTW) & 0x0ff);
	    *cdataptr++ = (unsigned char) (((short) (tempfloat * FTW) & 0x0ff00) >> 8);
	}
	else
	{
	    *cdataptr++ = 0x0ff;
	    *cdataptr++ = 0x07f;
	}

	/*
	    calculate the cosine of the angle and
	*/
	tempfloat = cos((double)(angle[i] * DTR));

	/*
	    convert to a word and store in cdata
	    NOTE: trap for cos(0)...since the bird
	    can only accept data from -1.000 to 0.99996 (0x8000 to 0x7fff)
	*/
	if (tempfloat < 0.99998)
	{
	    *cdataptr++ = (unsigned char) ((short) (tempfloat * FTW) & 0x0ff);
	    *cdataptr++ = (unsigned char) (((short) (tempfloat * FTW) & 0x0ff00) >> 8);
	}
	else
	{
	    *cdataptr++ = 0x0ff;
	    *cdataptr++ = 0x07f;
	}
    }

    /*
	Send the Command
    */
    if (send_serial_cmd(referframe_cdata,13) != 13)
	return(FALSE);

    printf("Reference Frame Sent to the Bird\n\r");
    hitkeycontinue();

    return(TRUE);
}

/*
    bird_reportrate -   Select the Report Rate for Stream Mode

    Prototype in:       birdcmds.h

    Parameters Passed:  void

    Return Value:       TRUE if successful
			FALSE if unsuccessful
			ESC_SEL if user selected ESC

    Remarks:            Queries the User for Bird Report Rate for STREAM
			mode...can be MAX, MAX/2, MAX/8, or MAX/32
*/
int bird_reportrate()
{
    unsigned char rate_cdata;
    static char * reportrate_menuptr[] =
				  {"Select the Report Rate (for STREAM mode):",  /* menu options */
				   "MAX",
				   "MAX/2",
				   "MAX/8",
				   "MAX/32"};
    /*
	Send the Menu to the User
    */
    switch (sendmenu(reportrate_menuptr,4))

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产成人精品在线看| 捆绑调教一区二区三区| 337p亚洲精品色噜噜噜| 丁香另类激情小说| 日本欧美大码aⅴ在线播放| 国产人久久人人人人爽| 91精品黄色片免费大全| 色综合久久综合网| 国产盗摄女厕一区二区三区| 日韩国产一二三区| 亚洲视频精选在线| 国产亚洲一区二区三区| 欧美成人一区二区| 欧美日韩成人激情| 色国产综合视频| jlzzjlzz欧美大全| 国产精品中文欧美| 精品一区二区三区在线播放| 午夜av一区二区| 一区二区三区日韩| 亚洲三级在线免费观看| 中文字幕欧美国产| 久久精品人人爽人人爽| 日韩精品在线一区| 国产精品久久久久婷婷| 国产欧美一区视频| 久久色在线观看| 2014亚洲片线观看视频免费| 欧美成人女星排行榜| 日韩欧美在线1卡| 欧美一区二区三区视频| 欧美丰满美乳xxx高潮www| 欧美色窝79yyyycom| 91久久精品一区二区二区| 91视频观看视频| 在线视频你懂得一区| 一本一道久久a久久精品 | 中文字幕视频一区二区三区久| 欧美videossexotv100| 日韩精品中文字幕一区| 精品电影一区二区三区 | ww亚洲ww在线观看国产| 欧美精品一区二区三区视频| 精品1区2区在线观看| 久久亚洲一区二区三区四区| 久久午夜羞羞影院免费观看| 久久久久一区二区三区四区| 国产视频亚洲色图| 国产精品第一页第二页第三页| 亚洲欧美一区二区在线观看| 亚洲人妖av一区二区| 亚洲精品视频观看| 天天综合天天综合色| 欧美日韩美少妇| 91精品免费在线观看| 日韩精品中文字幕一区二区三区 | 日本一区二区三区在线不卡| 国产视频不卡一区| 亚洲精品美国一| 婷婷综合另类小说色区| 久久国产人妖系列| 成人精品免费网站| 日本韩国精品一区二区在线观看| 欧美影院午夜播放| 欧美va天堂va视频va在线| 国产欧美日韩三级| 一区二区成人在线视频| 日本不卡1234视频| 欧美精品色一区二区三区| 91精品综合久久久久久| 国产网站一区二区三区| 一区二区在线观看视频| 蜜乳av一区二区三区| 成人精品视频.| 3atv一区二区三区| 国产精品久久三区| 亚洲成av人片在www色猫咪| 国产在线看一区| 日本韩国欧美在线| 久久久久久久久久看片| 亚洲午夜精品网| 国产激情一区二区三区桃花岛亚洲| 不卡一区在线观看| 欧美一区二区三区影视| 国产精品女主播在线观看| 午夜私人影院久久久久| 成人性生交大片免费看中文网站| 欧美无砖专区一中文字| 久久精品人人做人人爽人人| 亚洲国产日韩精品| 成人午夜av在线| 日韩欧美视频一区| 一区二区三区国产精品| 国产精品一区二区你懂的| 欧美日韩免费视频| 国产精品美女久久久久久 | 成人久久18免费网站麻豆| 欧美一区日韩一区| 一区二区三区日韩欧美精品| 国产美女娇喘av呻吟久久| 欧美高清视频不卡网| 成人免费在线播放视频| 黑人精品欧美一区二区蜜桃| 久久综合色鬼综合色| 免费在线看一区| 日韩精品每日更新| 91成人在线观看喷潮| 老司机精品视频一区二区三区| 色综合色狠狠天天综合色| 国产午夜亚洲精品羞羞网站| 免费看欧美女人艹b| 欧美日韩国产精选| 亚洲老妇xxxxxx| 成人免费视频一区| 久久影视一区二区| 久久激情五月婷婷| 欧美大片日本大片免费观看| 亚洲一卡二卡三卡四卡| 99精品视频在线免费观看| 国产亚洲短视频| 国产一区在线精品| 久久嫩草精品久久久精品一| 美女爽到高潮91| 欧美草草影院在线视频| 日本不卡在线视频| 欧美日韩国产123区| 亚洲一区二区在线免费看| 色婷婷久久久综合中文字幕| 中文字幕五月欧美| 91丨porny丨国产| 亚洲日本在线a| 在线观看区一区二| 亚洲夂夂婷婷色拍ww47| 欧美日韩中文字幕一区二区| 亚洲五码中文字幕| 色狠狠色噜噜噜综合网| 一级日本不卡的影视| 欧美在线视频日韩| 午夜精品在线看| 7777精品伊人久久久大香线蕉的 | 欧美日韩不卡一区二区| 亚洲激情av在线| 色屁屁一区二区| 亚洲综合小说图片| 精品视频在线免费看| 亚洲福利视频三区| 91精品国产入口| 狠狠狠色丁香婷婷综合久久五月| 精品国产免费人成电影在线观看四季| 久久99久久99小草精品免视看| 2024国产精品| www.av亚洲| 亚洲午夜精品久久久久久久久| 91蝌蚪porny九色| 亚洲香肠在线观看| 欧美一区二区三区四区视频| 九九久久精品视频| 欧美高清在线一区| 色噜噜偷拍精品综合在线| 亚洲成人精品在线观看| 欧美成人性福生活免费看| 东方欧美亚洲色图在线| 一区二区三区 在线观看视频| 欧美日本视频在线| 国产在线播精品第三| 国产精品国产成人国产三级 | 成人丝袜视频网| 亚洲乱码国产乱码精品精98午夜 | 男人的天堂久久精品| 久久在线免费观看| 色综合咪咪久久| 久久精品国产99国产精品| 国产日韩欧美激情| 色av成人天堂桃色av| 青青青爽久久午夜综合久久午夜| 国产欧美日韩精品在线| 在线观看一区不卡| 加勒比av一区二区| 亚洲欧美中日韩| 欧美一二三在线| 99久精品国产| 国产麻豆一精品一av一免费| 一区二区三区在线影院| 精品少妇一区二区三区免费观看 | 麻豆精品国产传媒mv男同| 国产欧美视频一区二区| 欧美精品乱码久久久久久| 国产69精品久久久久777| 日日摸夜夜添夜夜添精品视频 | 欧美无乱码久久久免费午夜一区| 黄色资源网久久资源365| 亚洲精品免费电影| 国产欧美精品一区二区三区四区| 欧美日韩在线电影| av一二三不卡影片| 激情综合色丁香一区二区| 亚洲综合小说图片| 中文字幕一区二区三区四区| wwwwww.欧美系列| 91精品国产高清一区二区三区蜜臀 |