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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? birdmain.c

?? 一個C語言寫的讀入位置跟蹤器數據的源程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/****************************************************************************
*****************************************************************************
    birdmain.c  - Bird Talk Main

    The Bird(tm) position and orientation measurement system is controled
    via a serial RS232 communication link.  This program allows the user
    to 'experiment' with the Bird by selecting control commands from a
    rudimentary menuing system.  After becoming familiar with the commands
    the user can CUT and PASTE code from the source files listed below for
    use in their own application.

    written for:    Ascension Technology Corporation
		    PO Box 527
		    Burlington, Vermont  05402

		    802-655-7879

    written by:     Jeff Finkelstein

    Modification History:

    10/18/90         jf  - released
    11/5/90          jf  - removed the 'Q' and the 'M' command from the Bird
			   initialization
    11/6/90          jf  - added new commands to mainmenu[]
    2/20/91          jf  - moved initialization of factory test to
			   birdloadconfig in BIRDCMDS.c
    4/23/91          jf  - removed ltoa() for NON-DOS applications
    4/24/91          jf  - added initconsole and restoreconsole routines
			   for UNIX platforms
    4/29/91          jf  - renamed birdpositionand.. to birdposand..
    5/20/91          jf  - add revision to Menu Header
    6/18/91          jf  - added FOB baudrate selections
    8/19/91          jf  - updated for prelimary release 3.0
    9/14/91          jf  - updated fob.c..release 3.01
    9/16/91          jf  - removed configuration menu..release 3.02
    10/18/91         jf  - max measurement rate changed to 144..release 3.03
    11/1/91          jf  - added chg/exm alpha max, glitch checking ..
			   release 3.04
    11/7/91          jf  - added exm model ..rev 3.05
    11/28/91         eb  - main menu item 0 changed to quit to DOS
    1/3/92           jf  - revised to revision ..rev 3.06
		     jf  - fixed button mode shutting off problem
    3/23/92          jf  - modified alpha min/max to tables
    3/27/92          jf  - added rs232 to fbb command
    4/7/92           jf  - added set xmtr type ..rev 3.07
		     mo  - added new output modes "Quaternions"
    4/20/92                and "Position/Quaternions"
    5/5/92           jf  - added system test menu selection ..rev 3.08
    6/1/92           jf  - updated examine value for new status
			   definitions ..rev 3.09
    10/12/92         jf  - modified printmatrix..rev 3.10
    11/3/92          jf  - updated for UNIX compatibility ..rev 3.11
    12/5/92          jf  - fixed bug in serpcpl getserialrecord which
			   caused data errors.. rev 3.12
    12/22/92         jf  - updated for Platform compatibility.. rev 3.13
    1/13/93          jf  - serial_init now displays the comport name to
			   to be used
    1/27/93          jf  - merged with MULTI232 for RS232 to FBB command
			   and Group Data Command Display
    1/31/93          jf  - ..rev 3.14 pre release
    2/23/93          jf  - updated for 3.14 release
			   Now, Max RS232 to FBB Data selection is only
			   available with the FACTORYTESTS compile switch
    3/22/93          jf  - added note to expanded error message
			   ..rev 3.15
    7/7/93           jf  - updated to allow button display from multiple
			   devices .. rev 3.16
    10/21/93         jf  - added code to redirect the IRQ 0 (PC TIMER) to
			   our own handler, thereby controlling the interrupt
			   latency.  This allows a DOS Protected Mode
			   Compiler (DPMC) to NOT swith into real mode
			   when the IRQ0 occurs. This revision works
			   with the MetaWare HIGH C compiler and the
			   PHARLAP DOS Extender 386...rev 3.17
    5/23/94          sw  - added BIRD SYSTEM STATUS check for extended/normal 
			   address mode (in Examine Value)
			 - Added XYZ Reference Frame in Examine Value and Change 
			   Value command menu.
			 - Corrected Vm and Alpha_m range tables
    6/23/94          sw  - corrected lockout on no device on comport by 
			   ingaging interupt handler through all of program.
			 - Changed rev number on main screen to 3.18
			 - Factory test of comport speed now works
    9/22/94          sw  - Corrected PCTIMER loop error which lead to lockup
			   on exit of program sometimes.
			 - Corrected "Exteneded" to "Expanded" address mode
			 - Changed rev number to reflect changes.
    5/11/95          sw  - Address mode is only checked in examine value if 
			   user selects a command that will require that information.
			 - Change rev number to reflect change.


       <<<< Copyright 1991 Ascension Technology Corporation >>>>
*****************************************************************************
****************************************************************************/
#include <stdio.h>          /* general I/O */
#include <stdlib.h>         /* for exit() */
#include <math.h>           /* float math */
#include "asctech.h"        /* Ascension Technology definitions */
#include "compiler.h"       /* Compiler Specific Header */
#include "menu.h"           /* Ascension Technology Menu Routines */
#include "serial.h"         /* Ascension Technology Serial Port Routines */
#include "birdcmds.h"       /* Bird Commands */
#include "rstofbb.h"        /* RS232 to FBB Command Info */
#include "cmdutil.h"
#include "pctimer.h"        /* Used to take over IRQ0 (PC TIMER) */
#include "birdmain.h"       /* Prototypes for this file */

/*
    Define Filename Globals
*/
char datafilename[81] = "BIRDDATA.dat";    /* default filename */
FILE * datafilestream;

extern unsigned char displaymultidataflg;
extern unsigned char displayliststartaddr;
extern unsigned char displayliststopaddr;
extern unsigned char fbbsystemstatus[];

#ifdef HIGHC
	void save_ds(void);
#endif

/*
    main                -   Main Program

    Prototype in:       no prototype...called by C startup Code

    Parameters Passed:  void

    Return Value:       0 if exited OK
		       -1 if exited with an error

    Remarks:            The main routine called by the C startup code contains
			the Bird initialization and the main menu selection.
			The routine initializes the serial port to COM1 at
			9600 baud by default.  Default factory addresses are
			also initialized prior to prompting the user with
			the menu selections.
*/

int main()
{
    /*
	Declare the Main Menu
    */
    short exitflag = FALSE;       /* exit flag */
    short buttonmode = 0;         /* holds the buttonmode, 0=manual, 1=send always */
    short tempbuttonmode;         /* temp value of buttonmode */
    unsigned char datamode = POSANGLE; /* default data mode */
    short user_sel;


    static char * mainmenuhdr =
"****************************************************************************\n\r\
* ASCENSION TECHNOLOGY CORPORATION - Bird Main Menu          Revision 3.21 *\n\r\
****************************************************************************\n\r";

    static char * mainmenuptr[] =
	       {"Main Menu Selections:",
		"Quit to DOS",
		"Position",
		"Angles",
		"Matrix",
		"Quaternions",
		"Position/Angles",
		"Position/Matrix",
		"Position/Quaternions",
		"Angle Align",
		"Hemisphere",
		"Reference Frame",
		"Report Rate",
		"Sleep/Wakeup",
		"Mouse Buttons",
		"XON/XOFF",
		"Change Value",
		"Examine Value",
		"Syncronization",
		"FBB Next Master",
		"FBB Next Transmitter",
		"Data Display List Address Init",
		"RS232 to FBB Address Init",
		"Set Transmitter Type",
		"Serial Port Configuration",
		"System Tests"};


#ifdef DOS  /* Redirect IRQ 0 to our own handler */
    pctimer_init(TICK_MSECS);
#endif
    
    /*
	Initialize the Position Conversion Constant
	...done here for compatibility with Coherent's Compiler,
	which can't evalute POSK36 at compile time
    */
    posk = POSK36;

    /*
	Initialize the Console Into Raw Mode..
	..for Menuing Compatibility under UNIX
    */
    if (!initconsole())
	exit(-1);

#ifdef HIGHC
	save_ds();                      /* save DS for interrupt handler */
#endif

    /*
	Call Serial Init in Case the user want COM2 or a different Baud Rate
    */
    if (!serialinit())
    {
	printf("** ERROR ** could not initialize the serial port\n\r");
	restoreconsole();
	exit(-1);
    }

    while (!exitflag)
    {
	sendmenuhdr(mainmenuhdr);

	/*
	    Clear the Receiver
	*/
	clear_rx();

	/*
	    Send the first screen
	*/
	switch (user_sel = sendmenu(mainmenuptr,25))
	{
	    case ESC_SEL:
		break;

	    case 0:     /* Quit */
		if (askyesno("Are you sure you want to quit") == YES)
		   exitflag = TRUE;
		break;

		 /* Pos/Orientation Output modes */

	    case 1:     /* Position */
	    case 2:     /* Angles */
	    case 3:     /* Matrix */
	    case 4:     /* Quaternions */
	    case 5:     /* Position/Angles */
	    case 6:     /* Position/Matrix */
	    case 7:     /* Position/Quaternions */

		/*
		   Set the Proper Data Mode
		*/
		switch(user_sel)
		{
		    case 1:
			datamode = POS;
			break;

		    case 2:
			datamode = ANGLE;
			break;

		    case 3:
			datamode = MATRIX;
			break;

		    case 4:
			datamode = QUATER;
			break;

		    case 5:
			datamode = POSANGLE;
			break;

		    case 6:
			datamode = POSMATRIX;
			break;

		    case 7:
			datamode = POSQUATER;
			break;
		}

		/*
		    Get the Data from the Bird
		*/
		getbirddata(datamode,buttonmode);
		break;

	    case 8:     /* Angle Align */
		bird_anglealign();
		break;

	    case 9:     /* Hemisphere */
		bird_hemisphere();
		break;

	    case 10:     /* Reference Frame */
		bird_referframe();
		break;

	    case 11 :    /* Report Rate */
		bird_reportrate();
		break;

	    case 12:    /* Sleep/Wakeup */
		bird_sleepwake();
		break;

	    case 13:    /* Mouse Buttons */
		if (!((tempbuttonmode = bird_mousebuttons()) == ESC_SEL))
		    buttonmode = tempbuttonmode;
		break;

	    case 14:   /* XON-XOFF */
		bird_xonxoff();
		break;

	    case 15:   /* Change Value */
		bird_changevalue();
		break;

	    case 16:   /* Examine Value */
		bird_examinevalue();
		break;

	    case 17:   /* CRT Synchronization */
		bird_crtsync();
		break;

	    case 18:   /* Next Master Command */
		nextmastercmd();
		break;

	    case 19:   /* Next Transmitter Command */
		nextxmtrcmd();
		break;

	    case 20:   /* Display List Initialization */
		displistinit();
		break;

	    case 21:   /* RS232 to FBB Pass Through Command */
		rs232tofbbcmd();
		break;

	    case 22:   /* Flock/ER XMTR */
		setxmtrtype();
		break;

	    case 23 :    /* Serial configuration */
		if (!serialinit())
		   return(FALSE);
		break;

	    case 24:   /* System Tests */
		alltests();
		break;
	}
    }

    /*
	Close the Data file if already open
    */
    if (datafilestream)
	fclose(datafilestream);

    /*
	Restore the Serial Configuration
    */
    restoreserialconfig();

    /*
	Restore console Configuration
    */
    restoreconsole();

#ifdef DOS  /* restore IRQ 0 handler */
    pctimer_restore();
#endif

    return(0);
}

/*
    getbirddata         Get Data from the Bird

    Prototype in:       birdmain.h

    Parameters Passed:  short outputmode - POINT, CONTINUOUS, STREAM
			unsigned char datamode - POS, ANGLE, POSANGLE..

    Return Value:       int TRUE if test ends normally
			int FALSE if failure
			int ESC_SEL if user escape

    Remarks:            set up to collect data from the Bird(s)
*/
int getbirddata(datamode,buttonmode)
unsigned char datamode;
short buttonmode;
{
    int retval;
    short outputmode;       /* POINT, CONTINUOUS, STREAM */

    /*
	Get the Outputmode from the user
    */
    if ((outputmode = get_output_mode()) == ESC_SEL)
	return(ESC_SEL);    /* If the user Selects ESC
			       ...skip the command */

    /*
	If NOT in GROUP DATA mode (see change value command)
	AND NOT in RS232 to FBB command mode get the data
	then get the data using the getsinglebirddata,
	else, use the getmultibirddata
    */
    if ((fbbgroupdataflg == FALSE) && (displaymultidataflg == FALSE))
	retval = (getsinglebirddata(outputmode,datamode,ON,buttonmode));
    else
	retval = (getmultibirddata(outputmode,datamode,ON,buttonmode));

    return(retval);
}

/*
    displistinit        Display List Initialization

    Prototype in:       birdmain.h

    Parameters Passed:  none

    Return Value:       TRUE if start/stop address set
			FALSE if not set
			ESC_SEL if the user selects ESCAPE

    Remarks:            setsup the display list Start and Stop Addresses
*/
int displistinit()
{
#ifdef SINGLEBIRDOPER
    int answer;
#endif

    /*
	Ask the user if they want to use Display Data from Multiple Devices
    */
    if (!fbbgroupdataflg)
    {
	printf ("\n\rThe Display List is used for display of data from Multiple 6DFOBs and\n\rhas no effect when the FBB Group Mode is enabled...\n\r");
#ifdef SINGLEBIRDOPER
	if ((answer = askyesno("\n\rDo you want enable display of data from Multiple 6DFOBs")) == ESC_SEL)
	{
	    return (ESC_SEL);
	}
	else
	{
	    /*
		Shut off the Command if the user answer NO
	    */
	    if (answer == FALSE)
	    {
		displaymultidataflg = FALSE;
		return (FALSE);
	    }
	}
#endif
    }
    else
    {
	printf ("\n\rCurrently in FBB Group Mode, therefore, the Display Start\n\rand Stop addresses are determined by AUTO CONFIGURATION\n\r");
	hitkeycontinue();
	return(TRUE);
    }

    /*
	get the addressing mode
    */
    if (getaddrmode() == 0)
	return(FALSE);

    /*
	Get the Destination Addresses
    */
    getfbbdestaddress(&displayliststartaddr,&displayliststopaddr);
    displaymultidataflg = TRUE;
    return(TRUE);

}

/* 
    alltests            All system test functions
    
    Prototype in:       birdmain.c

    Parameters Passed:  void

    Return Value:       TRUE if test ends normally
			FALSE otherwise

    Remarks:            Puts up a Menu for Test Selection
*/
int alltests()
{   
    static char * allsystestptr[] = {"Select Test:",
		  "Return to Main Menu",
		  "System Factory Tests",
		  "Max RS232 To FBB Data Rate",
		  "Noise statistics"};

    short testsel;

    testsel = sendmenu(allsystestptr,4);
    if (testsel < 0 )  return(FALSE);

    switch (testsel) {

       case 0:  /* return to main menu */
		return(TRUE);
       
       case 1:  /* System factory tests */
		systests();
		break;
	    

       case 2:  /* Maximum RS232 to FBB Data Rate */
		getmaxrs232tofbbrate();
		break;


       case 3:   /* Noise statistics */
		getbirdstatistics();
		break;
       }


  return(TRUE);

}

/*
    systests            System Tests

    Prototype in:       birdmain.c

    Parameters Passed:  void

    Return Value:       TRUE if test ends normally
			FALSE otherwise

    Remarks:            Puts up a Menu for Test Selection
*/
int systests()
{
    static char * systestptr[] = {"Select Test:",
		  "Return to Main Menu",
		  "Bird Output Test",
		  "Bird Echo Test",
		  "Host Data Read",
		  "Host Data Read Block"};

    static short systestnum[5] = {0,3,5,7,9};
    short testsel;

    testsel = sendmenu(systestptr,5);
    if (testsel > 0)       /* Return to Main Menu */
    {
	/*
	   Inform the User to Set the DIP switch correctly
	*/
	printf("** NOTE ** The DIP switch should be set to Test Number:  %d\n\r",
	       systestnum[testsel]);
	hitkeycontinue();

	switch(testsel)
	{

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩精品乱码免费| 99国产精品国产精品毛片| 911精品国产一区二区在线| 伊人婷婷欧美激情| 欧美性高清videossexo| 天天av天天翘天天综合网| 欧美三级午夜理伦三级中视频| 图片区日韩欧美亚洲| 777久久久精品| 国产一区二三区| 精品日韩欧美在线| jlzzjlzz亚洲日本少妇| 亚洲欧洲日产国码二区| 色综合天天做天天爱| 中文字幕成人在线观看| 色综合天天天天做夜夜夜夜做| 亚洲欧洲www| 91精品国产综合久久香蕉的特点| 亚洲自拍偷拍网站| 久久美女高清视频| 色婷婷精品大视频在线蜜桃视频| 亚洲一区在线电影| 欧美大片日本大片免费观看| 美女一区二区三区在线观看| 欧美激情一区二区三区蜜桃视频| eeuss国产一区二区三区| 性做久久久久久免费观看| 色综合婷婷久久| 国产一级精品在线| 日韩成人一级大片| 亚洲欧洲av另类| 欧美精品在线观看一区二区| 丁香网亚洲国际| 老司机免费视频一区二区| 国产精品二区一区二区aⅴ污介绍| 午夜视频在线观看一区二区三区| 青青草国产成人99久久| www精品美女久久久tv| 欧美日韩视频专区在线播放| 精品亚洲成a人| 美日韩黄色大片| 人人超碰91尤物精品国产| 亚洲码国产岛国毛片在线| 久久久久久久综合色一本| 欧美视频精品在线| 99精品偷自拍| 91在线丨porny丨国产| 日韩中文字幕一区二区三区| 亚洲高清视频的网址| 婷婷综合久久一区二区三区| 国产精品天美传媒| 亚洲精品网站在线观看| 亚洲一区二区三区精品在线| 一区二区三区四区乱视频| 亚洲精品视频一区二区| 亚洲精品中文字幕在线观看| 亚洲福利国产精品| 亚洲福中文字幕伊人影院| 麻豆成人在线观看| 成年人国产精品| 欧美精品电影在线播放| 日韩女优av电影| 日韩欧美亚洲国产精品字幕久久久| 欧美mv和日韩mv国产网站| 亚洲三级小视频| 久久se精品一区二区| 99在线精品一区二区三区| 欧美日韩一级黄| 久久综合九色综合97婷婷| 亚洲欧美日韩成人高清在线一区| 樱花影视一区二区| 国产一区二区美女诱惑| 欧美性感一区二区三区| 久久精品人人做人人爽97| 亚洲女爱视频在线| 国产精品18久久久久久久久久久久 | 精品区一区二区| 亚洲午夜一二三区视频| eeuss鲁片一区二区三区在线看| 4438x亚洲最大成人网| 欧美—级在线免费片| 婷婷中文字幕综合| 欧美日韩在线免费视频| 亚洲欧美一区二区三区孕妇| av不卡免费电影| 亚洲欧洲日本在线| 99久久精品一区二区| 国产精品久久三区| 97久久超碰国产精品| 亚洲天堂免费看| 在线免费视频一区二区| 亚洲欧美综合在线精品| 国产99精品国产| 国产欧美一区二区精品性色| 高清国产一区二区三区| 中文字幕第一区二区| 盗摄精品av一区二区三区| 国产喷白浆一区二区三区| 99视频精品免费视频| 4hu四虎永久在线影院成人| 精品不卡在线视频| 免费一级片91| 国产婷婷色一区二区三区| 99视频精品在线| 亚洲成人免费视频| 777久久久精品| 波多野结衣精品在线| 一区二区视频免费在线观看| 欧美精品高清视频| 国产精品白丝av| 日本伊人色综合网| 国产精品久久夜| 精品理论电影在线观看| 在线视频观看一区| 久久精品二区亚洲w码| 亚洲小少妇裸体bbw| 中文字幕欧美激情一区| 日韩一区二区三区视频在线| 99国产精品久| 国产一区二区看久久| 久草精品在线观看| 日韩精品乱码免费| 日韩高清在线不卡| 亚洲1区2区3区4区| 午夜亚洲福利老司机| 亚洲女人的天堂| 偷拍亚洲欧洲综合| 黄网站免费久久| 成人午夜电影网站| 欧美在线观看视频在线| 欧美精品久久久久久久多人混战| 日韩欧美一区二区在线视频| 欧美精品一区二区三区一线天视频 | 国产91对白在线观看九色| 高清国产一区二区三区| 欧美色爱综合网| 久久午夜电影网| 视频在线观看一区| 国产91精品露脸国语对白| 欧美亚洲综合在线| xvideos.蜜桃一区二区| 一区二区在线观看免费| 国产一区二区h| 欧美丰满少妇xxxbbb| 亚洲私人黄色宅男| 日本亚洲欧美天堂免费| 欧亚洲嫩模精品一区三区| 欧美国产成人精品| 国产乱码精品一区二区三区忘忧草| 91在线国产观看| 中文字幕一区日韩精品欧美| 另类的小说在线视频另类成人小视频在线| 99久久精品国产毛片| 国产亚洲精品精华液| 九九**精品视频免费播放| 欧美在线999| 一级日本不卡的影视| av一区二区三区四区| 国产免费成人在线视频| 国产精品综合久久| 国产色产综合色产在线视频| 美女视频免费一区| 国产亚洲欧美日韩俺去了| 国内不卡的二区三区中文字幕| 91精品啪在线观看国产60岁| 日韩成人午夜精品| 欧美tickle裸体挠脚心vk| 国产精品一二三区在线| 国产欧美日韩亚州综合| www.亚洲人| 人人精品人人爱| 欧美国产成人在线| 欧美日韩另类国产亚洲欧美一级| 亚洲电影你懂得| 精品国产乱码久久久久久蜜臀| 国模冰冰炮一区二区| 国产99久久久国产精品潘金网站| 在线不卡a资源高清| 国产91对白在线观看九色| 亚洲精品国产精品乱码不99| 日韩精品一区二区三区在线观看| 国产99久久久久| 奇米精品一区二区三区在线观看 | 久久国产成人午夜av影院| 国产三级欧美三级| 91麻豆精品国产91久久久| 91网址在线看| 丁香婷婷综合网| 韩国女主播一区| 日本视频免费一区| 亚洲香肠在线观看| 亚洲精品免费一二三区| 国产精品美女久久久久久久网站| 欧美一区2区视频在线观看| 欧美日本国产视频| 色综合一个色综合| 成人免费看的视频| 国产精品一区二区免费不卡| 老司机精品视频导航| 久久精品国产久精国产爱|