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

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

?? cmdutil.c

?? 一個C語言寫的讀入位置跟蹤器數(shù)據(jù)的源程序
?? C
?? 第 1 頁 / 共 3 頁
字號:
/****************************************************************************
*****************************************************************************
    cmdutil.c       - Bird Command Utilities Routine

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

    by:             Jeff Finkelstein
		    802-985-2535


    Modification History:
			4/29/91        jf  - created from BIRDCMDS.c
			5/20/91            jf  - fixed row/col order in printmatrix
	    9/16/91        jf  - added showfbbconfig
	    2/25/92        jf  - removed showfbbconfig
	    4/7/92         jf  - added fprintmatrix
	    4/20/92        mo  - added fprintquaternions() and
				 printquaternions().
	    10/12/92       jf  - modified to display 3 sig. digits for Matrix
	    12/23/92       jf  - updated readbirddata to be CPU independent
				 by using C types to define byte ordering
	    1/26/93        jf  - added functions to print/file for all
				 output modes
			   jf  - modified readbirddata to read an extra
				 character if in fbbgroupdata mode
	    2/26/93        jf  - added getsystemstatus
	    3/1/93         jf  - added checkerrorstatus
			       - added displayerror
			       - added getsystemstatus
	    3/22/93        jf  - added expanded error 'Note'
	    6/22/94        ssw - modified getaddmode to include setting IRQ 0
				 fix to stop lockout

	   <<<< 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"        /* cmdutil.header */

/*
    External Definitions
*/

extern float crystalfreq;
extern short buttonvalue;
extern float posk;
extern unsigned char fbbgroupdataflg;
extern short numfbbaddrs;
extern short numfbbrcvrs;
extern unsigned char fbbsystemstatus[];
extern unsigned char rs232tofbbstartaddr;
extern unsigned char displayliststartaddr;
extern unsigned char displayliststopaddr;
extern unsigned char displaymultidataflg;

/*
    Definitions Expanded Error Decoding
*/
unsigned char fbbaddrbits;
unsigned char cmdbitshft;

/*
    readbirddata        -   Read Bird Data and convert to 2's complement

    Prototype in:       cmdutil.h

    Parameters Passed:  birddata    - pointer to integer array to store data
			numwords    - number of words (16 bits) to read
			outputmode  - POINT, CONTINUOUS, or STREAM
			buttonmode  - 0 if off, 1 if on (send button value)

    Return Value:       TRUE if successful
			FALSE otherwise

    Remarks:            routine reads a record from the bird, and adjusts
			the least and most significant Bird bytes into 2's
			complemented words.
*/
int readbirddata(birddata,numwords,outputmode,buttonmode)
short * birddata;
short numwords;
short outputmode;
short buttonmode;
{
	short i;
    short extrachar=0;

    if (fbbgroupdataflg)
	extrachar = 1;

    /*
	Read 2*numbwords characters from the bird, check for errors
	...add one character to record length if buttonmode == 1
    */
    if ((get_serial_record((unsigned char *)birddata,
			   (2 * numwords) + buttonmode + extrachar,
			   outputmode)) < 0)
    {
	if (outputmode == STREAM)
		send_serial_cmd((unsigned char *)"B",1);     /* stop streaming, via Point cmd */
	printf("\n\r** ERROR ** could not read record data from the BIRD\n\r");
	hitkeycontinue();
	return(FALSE);
    }

    /*
	go though the birddata and make into two's complemented
	16 bit integers by:
	    - lsbyte << 1
	    - word << 1
    */
    for (i=0;i<numwords;i++)
    {
	/*
	   MOTOROLA and some RISC CPUs place
	   the high order byte of a 16 bit word in the lower address of
	   memory whereas INTEL like CPUs place the high order bytes in the
	   higher addresses...therefore this operation must be CPU
		   independent
	*/
	*birddata++ = (short)((((short)(*(unsigned char *) birddata) & 0x7F) |
				(short)(*((unsigned char *) birddata+1)) << 7)) << 2;
    }
    
    /*
	Read the Button Value if Required
	...Note that birddata currently points to the button value
    */
    if (buttonmode)
		buttonvalue = (short)(*(unsigned char *)birddata);

    return(TRUE);
}

/*
    check_done          -   Check to seed if Data Output Done

    Prototype in:       cmdutil.h

    Parameters Passed:  outputmode      - output mode POINT,CONTINUOUS, STREAM

    Return Value:       TRUE if done
			FALSE otherwise

    Remarks:            POINT mode:
			    - wait for key hit
			    - if B/b return FALSE
			      else, return TRUE

			CONTINUOUS mode:
			    - if key hit return TRUE
			      else, return FALSE

			STREAM mode:
			    - if key hit
				send 'B' command to turn off stream mode
				return TRUE
			      else, return FALSE
*/
int check_done(outputmode)
short outputmode;
{
	short chr;            /* character returned from getch() */

    /*
	Do this as a function of POINT, CONTINUOUS, or STREAM outputmode
    */
    switch (outputmode)
    {
	case STREAM:
	    if (ckkbhit())
	    {
		clearkey();                 /* clear the keyboard */
		send_serial_cmd((unsigned char *)"B",1);     /* stop streaming, via Point cmd */
		if (phaseerror_count)       /* inform the user of phase errors */
					printf("*NOTE* %d Phase Errors have occured\n\r",phaseerror_count);

		break;                        /* return TRUE */
	    }
	    return(FALSE);                  /* not done */

	case CONTINUOUS:
	    if (ckkbhit())                  /* if key hit... */
	    {
		clearkey();                 /* clear the keyboard */
		break;
	    }
	    else                            /* no key hit .. continue */
	    {
		if (send_serial_cmd((unsigned char *)"B",1) != 1) /* get another set of points */
		    return(TRUE);           /* return done if errors */

		return(FALSE);              /* continue */
	    }

	case POINT:
	    while (!ckkbhit());               /* wait for a key */
	    chr = getkey();                   /* get the character */
	    if ((chr == 'B') || (chr == 'b')) /* check if a B or b */
	    {
		send_serial_cmd((unsigned char *)"B",1);     /* get another set of points */
		return(FALSE);              /* return not done */
	    }
	    break;
    }

    /*
	Wait for the user to see the data
    */
    hitkeycontinue();
    return(TRUE);               /* indicate done */
}

/*
    displaybirddata     Display and File the Bird Data

    Prototype in:       cmdutil.h

    Parameters Passed:  birddata - array of birddata
			unsigned char datamode - POS, ANGLE, POSANGLE..
			buttonmode - ON/OFF
			datafilestream - file to store data in..if any

    Return Value:       void

    Remarks:

*/
int displaybirddata(birddata, datamode, buttonmode, displayon, displayaddr, datafilestream)
short * birddata;
unsigned char datamode;
short buttonmode;
unsigned char displayon;
unsigned char displayaddr;
FILE * datafilestream;
{
    short displaysize;
    unsigned char * tempbirddata;

    /*
	Use tempbirddata to point to individual characters in
	the birddata
    */
    tempbirddata = (unsigned char *) birddata;

    /*
	Display the address at  the begginning if in RS232TOFBB mode

	Display the Address information at the end if in the
	group data mode.. since that is where the address information
	is within the data stream
    */
    if ((displaymultidataflg) && (!fbbgroupdataflg))
    {
	if (displayon)
	    printf("%d ", displayaddr);

	if (datafilestream)
	    fprintf(datafilestream,"%d ", displayaddr);
    }

    /*
       Set the for the number of WORDs (16 bits) and Pos/Orientation Mode
       command
    */
    switch(datamode)
    {
	case POS:
	    displaysize = printposition((short *) tempbirddata,buttonmode,displayon,datafilestream);
	    break;

	case ANGLE:
	    displaysize = printangles((short *) tempbirddata,buttonmode,displayon,datafilestream);
	    break;

	case MATRIX:
	    displaysize = printmatrix((short *) tempbirddata,buttonmode,displayon,datafilestream);
	    break;

	case QUATER:
	    displaysize = printquaternions((short *) tempbirddata,buttonmode,displayon,datafilestream);
	    break;

	case POSANGLE:
	    displaysize = printposangles((short *) tempbirddata,buttonmode,displayon,datafilestream);
	    break;

	case POSMATRIX:
	    displaysize = printposmatrix((short *) tempbirddata,buttonmode,displayon,datafilestream);
	    break;

	case POSQUATER:
	    displaysize = printposquaternions((short *) tempbirddata,buttonmode,displayon,datafilestream);
	    break;

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

    /*
	If in Group Data Mode, print the address just received
    */
    if (fbbgroupdataflg)
    {
	/*
	    get to the addr loc
	*/
	tempbirddata += ((displaysize * 2) + buttonmode);
	if (displayon)
	    printf("    %d", *tempbirddata); /* print the address */

	if (datafilestream)
	    fprintf(datafilestream, "    %d", *tempbirddata);

	tempbirddata += 1;                   /* increment the pointer */
    }

    /*
	Set up for the next line
    */
    if (displayon)
    {
	printf("\n\r");
	if ((datamode == MATRIX) || (datamode == POSMATRIX))
	    printf("\n\r");
    }

    if (datafilestream)
    {
	fprintf(datafilestream,"\n");
	if ((datamode == MATRIX) || (datamode == POSMATRIX))
	    fprintf(datafilestream,"\n");
    }

    return(displaysize);
}

/*
    printposition       Print and File the Position Data

    Prototype in:       cmdutil.h

    Parameters Passed:  birddata - array of birddata
			buttonmode - ON/OFF
			displayon - DISPLAYON/OFF
			datafilestream - file to store data in..if any

    Return Value:       int 3

    Remarks:
*/
int printposition(birddata,buttonmode,displayon,datafilestream)
short * birddata;
short buttonmode;
unsigned char displayon;
FILE * datafilestream;
{
    short i;
    float floatdata[3];
    char * printdataformat = "\t%7.2f\t%7.2f\t%7.2f";
    char * printbuttonformat = "\t%3d";

    /*
	Only compute if display or file is enabled
    */
    if ((displayon) || (datafilestream))
    {
	for (i=0;i<3;i++)
	    floatdata[i] = (float)(birddata[i] * posk);
    }

    /*
	Display the Data and Button Value (if required)
    */
    if (displayon)
    {
	printf(printdataformat,floatdata[0],floatdata[1],floatdata[2]);
	if (buttonmode != 0)
	    printf(printbuttonformat, buttonvalue);
    }

    /*
	Save the Data to a File...only if one exists!
    */
    if (datafilestream)
    {
	/*
	    print the data to the file
	*/
	fprintf(datafilestream,printdataformat,
		floatdata[0],floatdata[1],floatdata[2]);

	/*
	    save the Button Value if required
	*/
	if (buttonmode != 0)
	    fprintf(datafilestream, printbuttonformat, buttonvalue);
    }
    return(3);
}

/*
    printangles         Print and File the Angle Data

    Prototype in:       cmdutil.h

    Parameters Passed:  birddata - array of birddata
			buttonmode - ON/OFF
			displayon - DISPLAYON/OFF
			datafilestream - file to store data in..if any

    Return Value:       int 3

    Remarks:
*/
int printangles(birddata,buttonmode,displayon,datafilestream)
short * birddata;
short buttonmode;
unsigned char displayon;
FILE * datafilestream;
{
    short i;
    float floatdata[3];
    char * printdataformat = "\t%7.2f\t%7.2f\t%7.2f";
    char * printbuttonformat = "\t%3d";

    /*
	Only compute if display or file is enabled
    */
    if ((displayon) || (datafilestream))
    {
	for (i=0;i<3;i++)
	    floatdata[i] = (float)(birddata[i] * ANGK);
    }

    /*
	Display the Data and Button Value (if required)
    */
    if (displayon)
    {
	printf(printdataformat,floatdata[0],floatdata[1],floatdata[2]);
	if (buttonmode != 0)
	    printf(printbuttonformat, buttonvalue);
    }

    /*
	Save the Data to a File...only if one exists!
    */
    if (datafilestream)
    {
	/*
	    print the data to the file
	*/
	fprintf(datafilestream,printdataformat,
		floatdata[0],floatdata[1],floatdata[2]);

	/*
	    save the Button Value if required
	*/
	if (buttonmode != 0)
	    fprintf(datafilestream, printbuttonformat, buttonvalue);

    }
    return(3);
}

/*
    printmatrix         Print and File the Matrix Data

    Prototype in:       cmdutil.h

    Parameters Passed:  birddata - array of birddata
			buttonmode - ON/OFF
			displayon - DISPLAYON/OFF
			datafilestream - file to store data in..if any

    Return Value:       int 9

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品自拍偷拍| 国产午夜亚洲精品午夜鲁丝片| 青娱乐精品视频| 国产午夜精品在线观看| 欧美午夜精品一区二区蜜桃| 裸体在线国模精品偷拍| 亚洲精选视频在线| 日韩欧美一级精品久久| 欧美在线你懂的| 国产白丝精品91爽爽久久| 爽好久久久欧美精品| 国产精品美女一区二区在线观看| 4438x亚洲最大成人网| 成人不卡免费av| 极品瑜伽女神91| 亚洲va中文字幕| 亚洲欧美日韩国产综合在线 | 精品国产伦一区二区三区免费| 91色|porny| 国产91丝袜在线观看| 麻豆久久久久久| 午夜在线成人av| 亚洲精品高清视频在线观看| 中国av一区二区三区| 精品国产91洋老外米糕| 欧美美女喷水视频| 欧美日韩在线不卡| 色噜噜狠狠色综合中国| 99久久精品费精品国产一区二区| 国产激情偷乱视频一区二区三区| 男女视频一区二区| 天堂蜜桃91精品| 亚洲国产视频一区| 一区二区三区四区不卡在线 | 日本成人在线电影网| 亚洲观看高清完整版在线观看| 一区在线播放视频| 国产精品视频一二| 中文在线资源观看网站视频免费不卡| 日韩精品一区二区三区swag| 欧美一级理论性理论a| 欧美高清视频一二三区| 欧美日韩不卡在线| 欧美视频三区在线播放| 欧美天天综合网| 欧美日韩成人综合在线一区二区| 欧美日高清视频| 欧美日韩精品一区二区三区四区 | 欧美国产乱子伦| 亚洲国产精品黑人久久久| 久久久久久久久久久久电影| 国产午夜亚洲精品不卡 | 五月婷婷另类国产| 偷窥国产亚洲免费视频| 同产精品九九九| 蜜臀av性久久久久蜜臀aⅴ| 蜜臀精品久久久久久蜜臀| 精品一区二区在线观看| 国产激情一区二区三区四区| a级高清视频欧美日韩| 99久久久无码国产精品| 欧洲精品在线观看| 欧美人妇做爰xxxⅹ性高电影 | av网站免费线看精品| 91天堂素人约啪| 欧美无人高清视频在线观看| 日韩视频一区二区三区| 久久免费看少妇高潮| 亚洲人成亚洲人成在线观看图片 | 国产真实乱子伦精品视频| 岛国av在线一区| 日本伦理一区二区| 欧美va亚洲va| 国产精品国产三级国产aⅴ中文| 亚洲乱码国产乱码精品精小说 | 国内偷窥港台综合视频在线播放| 国产91精品一区二区麻豆亚洲| 91碰在线视频| 欧美一区二区三区视频在线观看| 久久婷婷一区二区三区| 国产精品国产三级国产a| 亚洲成av人**亚洲成av**| 紧缚奴在线一区二区三区| 91日韩在线专区| 精品日韩一区二区三区| 亚洲视频一区二区在线| 日本成人中文字幕在线视频| 成人看片黄a免费看在线| 欧美日韩另类国产亚洲欧美一级| 国产调教视频一区| 午夜欧美一区二区三区在线播放| 国产一区二区不卡| 欧美伊人精品成人久久综合97| 欧美videossexotv100| 樱桃国产成人精品视频| 九色综合国产一区二区三区| 91蝌蚪porny九色| 精品国产123| 伊人色综合久久天天| 国产精品一区二区三区乱码| 欧美日韩日本视频| 国产精品日韩精品欧美在线| 老司机精品视频一区二区三区| 91麻豆免费看| 国产片一区二区三区| 三级欧美韩日大片在线看| 99麻豆久久久国产精品免费 | 亚洲黄色片在线观看| 国产一区不卡视频| 欧美精品自拍偷拍| 亚洲婷婷综合久久一本伊一区 | 福利电影一区二区三区| 91精品欧美久久久久久动漫| 亚洲女与黑人做爰| 懂色中文一区二区在线播放| 日韩欧美区一区二| 视频一区二区欧美| 欧美影片第一页| 中文字幕日韩精品一区| 国产成人在线视频网址| 日韩欧美第一区| 日韩电影在线一区二区| 欧美日韩一区二区在线观看视频| 亚洲私人影院在线观看| 成人av手机在线观看| 国产性色一区二区| 韩国女主播一区二区三区| 精品免费国产二区三区| 日韩成人午夜电影| 91精品国产综合久久蜜臀| 一区二区三区资源| 97se亚洲国产综合自在线不卡| 国产欧美va欧美不卡在线| 国产激情偷乱视频一区二区三区 | 欧美激情一区二区三区在线| 国产一区二区福利视频| 久久天天做天天爱综合色| 毛片一区二区三区| 日韩欧美国产1| 久久精品国产亚洲高清剧情介绍| 日韩一区二区三区高清免费看看| 秋霞成人午夜伦在线观看| 欧美一级精品大片| 国模一区二区三区白浆| 精品国产精品网麻豆系列| 极品销魂美女一区二区三区| 亚洲精品一区在线观看| 国产一区在线观看视频| 国产欧美精品一区二区色综合| 国产成人免费在线视频| 国产精品乱码一区二三区小蝌蚪| jizz一区二区| 亚洲乱码国产乱码精品精的特点 | 欧美撒尿777hd撒尿| 亚洲黄色免费网站| 欧美猛男男办公室激情| 蜜桃视频免费观看一区| 精品少妇一区二区三区在线视频| 国产在线视频不卡二| 国产日韩欧美精品一区| 91丨porny丨首页| 亚洲国产欧美日韩另类综合 | 亚洲日本成人在线观看| 欧美午夜在线一二页| 免费成人性网站| 国产亚洲精品中文字幕| 91一区二区三区在线观看| 午夜久久久久久| 精品国产电影一区二区| 成人免费av资源| 香蕉加勒比综合久久| 欧美精品一区二| 色婷婷av一区二区三区之一色屋| 日韩高清欧美激情| 久久久99久久| 色狠狠桃花综合| 另类小说图片综合网| 国产精品每日更新| 欧美日韩黄色一区二区| 国产精品自拍网站| 亚洲男同性视频| 日韩精品资源二区在线| eeuss鲁片一区二区三区在线看| 亚洲国产精品尤物yw在线观看| 欧美变态tickle挠乳网站| 99视频精品全部免费在线| 日韩高清电影一区| 国产精品电影一区二区三区| 日韩一级大片在线| 99精品偷自拍| 久久精品国产成人一区二区三区| 最近日韩中文字幕| 精品欧美乱码久久久久久1区2区| 91在线国产福利| 极品少妇xxxx精品少妇| 一区二区三区在线免费观看| 久久久精品国产99久久精品芒果| 欧美日韩午夜在线| 99国产精品视频免费观看| 久久99精品国产.久久久久|