⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bit.c

📁 源程序是在VisualDSP环境下开发出来的
💻 C
📖 第 1 页 / 共 2 页
字号:
#include <math.h>

#include "hddamacros.h"
#include "globalvar.h"
#include "drawgraph.h"
#include "textout.h"
#include "asmfunctions.h"
#include "stdio.h"
void ERRproc(int x,int y)
{
	Line(x,y,x+20,y+20,RED,BFINALRESULT);
	Line(x+20,y,x,y+20,RED,BFINALRESULT);
	return;
}//ERROR CROSS
//////////////////////////////////
//////////////////////////////////
void STARBITproc(int x,int y)
{
	Line(x,y,x+60,y,YELLOW,BFINALRESULT);
	return;
}////in bit
/////////////////////////////////
/////////////////////////////////////////////////////////////////
void BITMENUproc(void)
{
	StringOut("ADC",LEFT,LINE1,GREEN1,BFINALRESULT);
	StringOut("RA",LEFT,LINE2,GREEN1,BFINALRESULT);
	StringOut("TCN",LEFT,LINE3,GREEN1,BFINALRESULT);
	StringOut("IBIT",(LEFT+ROW1)/2,TOP,YELLOW,BFINALRESULT);
	StringOut("FMFD",RIGHT,LINE1,GREEN1,BFINALRESULT);
	StringOut("LMFD",RIGHT,LINE2,GREEN1,BFINALRESULT);
	StringOut("RMFD",RIGHT,LINE3,GREEN1,BFINALRESULT);
	StringOut("MC",RIGHT,LINE4,GREEN1,BFINALRESULT);
	return;
}
/*	{if((g_nParameters[7]&0x10)==0x0)
	{
		ERRproc(ROW1+20,LINE1);
	}///ADC
	if((g_nParameters[8]&0x40)==0x0)
	{
		ERRproc(ROW5,LINE4);
	}///MC
	if((g_nParameters[8]&0x20)==0x0)
	{
		ERRproc(ROW5,LINE1);
	}//FMFD
	if((g_nParameters[8]&0x10)==0x0)
	{
		ERRproc(ROW5,LINE2);
	}///LMFD
	if((g_nParameters[8]&0x8)==0x0)
	{
		ERRproc(ROW5,LINE3);
	}///RMFD
}*/
void RESproc(int a,int b,int x,int y)
{
if((g_nParameters[a]&b)==0x0)
	{
		ERRproc(x,y);
	}///
}
///////////////////////////////////////////
void STARTBITproc(int x,int y,int a,int b,int x1,int y1)
{
	STARBITproc(x,y);
	RESproc(a,b,x1,y1);
	BITMENUproc();
	return;
}
//////////////////////////////////////////////////////////////
void BITMAINproc(void)
{
	BITMENUproc();
	return;
}
/////////////////////////////////////////
void BITproc(void)
{
	
	switch(g_nParameters[3])
	{
		case 0:		BITMAINproc();break;
		case 23:	STARTBITproc(LEFT,LINE1+20,7,0x10,ROW1+20,LINE1);break;//ADC
		case 60:	STARTBITproc(RIGHT,LINE4+20,8,0x40,ROW5,LINE4);break;//MC
		case 61:	STARTBITproc(RIGHT,LINE1+20,8,0x20,ROW5,LINE1);break;//FMFD
		case 62:	STARTBITproc(RIGHT,LINE2+20,8,0x10,ROW5,LINE2);break;//LMFD
		case 63:	STARTBITproc(RIGHT,LINE3+20,8,0x8,ROW5,LINE3);break;//RMFD
		default:	break;
	}
	return;
}

/////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////
void MFLMAINproc(void)
{
	StringOut("ADC",LEFT,LINE1,GREEN1,BFINALRESULT);
	StringOut("TCN",LEFT,LINE2,GREEN1,BFINALRESULT);
	StringOut("HZX",LEFT,LINE3,GREEN1,BFINALRESULT);
	StringOut("RA",LEFT,LINE4,GREEN1,BFINALRESULT);
	StringOut("RSU",LEFT,LINE5,GREEN1,BFINALRESULT);
	StringOut("MFL",(LEFT+ROW1)/2,TOP,YELLOW,BFINALRESULT);
	StringOut("FC-NAV",RIGHT,LINE1,GREEN1,BFINALRESULT);
	STARBITproc(LEFT,LINE1+20);
	STARBITproc(LEFT,LINE2+20);
	STARBITproc(LEFT,LINE4+20);
	STARBITproc(RIGHT,LINE1+20);
	RESproc(7,0x10,ROW1+20,LINE1);
	RESproc(7,0x4,ROW1+20,LINE3);
	RESproc(7,0x1,ROW1+20,LINE5);
	RESproc(8,0x80,ROW5,LINE1);
	return;
}
////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
void MFLADCproc()
{	
	char temp1[10];
	int color=RED;
	bool berr=false;
	if((g_nParameters[7]&0x10)==0x0)
	{
		berr=true;	
		StringOut("ADC ERR",ROW2+50,TOP,RED,BFINALRESULT|BIGFONT);///ADC OK
	}
	else
	{
		StringOut("ADC OK",ROW2+50,TOP,GREEN1,BFINALRESULT|BIGFONT);///ADC OK
	}
	StringOut("DATA",ROW1+50,LINE1+30,GREEN1,BFINALRESULT);
	StringOut("TEST RESULT",ROW4,LINE1+30,GREEN1,BFINALRESULT);
	StringOut("Hc",ROW1-50,LINE1+60,GREEN1,BFINALRESULT);
	StringOut("M",ROW1-50,LINE1+90,GREEN1,BFINALRESULT);
	StringOut("Vi",ROW1-50,LINE1+120,GREEN1,BFINALRESULT);
	StringOut("Vt",ROW1-50,LINE1+150,GREEN1,BFINALRESULT);
	StringOut("VV",ROW1-50,LINE1+180,GREEN1,BFINALRESULT);
	StringOut("Pbs",ROW1-50,LINE1+210,GREEN1,BFINALRESULT);
	StringOut("%",ROW1-50,LINE1+240,GREEN1,BFINALRESULT);

	StringOut("30545~30675",ROW1+50,LINE1+60,CAMBLUE,BFINALRESULT);
	StringOut("ft",ROW3+30,LINE1+60,CAMBLUE,BFINALRESULT);
	if((g_nParameters[11]>=30545)&&(g_nParameters[11]<=30675))color=GREEN1;
	sprintf(temp1,"%d",g_nParameters[11]);
	StringOut(temp1,ROW4,LINE1+60,color,BFINALRESULT);

	StringOut("0.933~0.953",ROW1+50,LINE1+90,CAMBLUE,BFINALRESULT);
	color=RED;
	if((g_nParameters[12]>=0.933)&&(g_nParameters[12]<=0.953))color=GREEN1;
	sprintf(temp1,"%5.3f",g_nParameters[12]);
	StringOut(temp1,ROW4,LINE1+90,color,BFINALRESULT);

	StringOut("331.8~338.2",ROW1+50,LINE1+120,CAMBLUE,BFINALRESULT);
	StringOut("kn",ROW3+30,LINE1+120,CAMBLUE,BFINALRESULT);
	color=RED;
	if((g_nParameters[13]>=331.8)&&(g_nParameters[13]<=338.2))color=GREEN1;
	sprintf(temp1,"%5.1f",g_nParameters[13]);
	StringOut(temp1,ROW4,LINE1+120,color,BFINALRESULT);

	StringOut("504.59~551.29",ROW1+50,LINE1+150,CAMBLUE,BFINALRESULT);
	StringOut("kn",ROW3+30,LINE1+150,CAMBLUE,BFINALRESULT);
	color=RED;
	if((g_nParameters[14]>=504.59)&&(g_nParameters[14]<=551.29))color=GREEN1;
	sprintf(temp1,"%5.1f",g_nParameters[14]);
	StringOut(temp1,ROW4,LINE1+150,color,BFINALRESULT);

	StringOut("-590.5~590.5",ROW1+50,LINE1+180,CAMBLUE,BFINALRESULT);
	StringOut("ft+min",ROW3+30,LINE1+180,CAMBLUE,BFINALRESULT);
	color=RED;
	if((g_nParameters[15]>=-590.5)&&(g_nParameters[15]<=590.5))color=GREEN1;
	sprintf(temp1,"%6.1f",g_nParameters[15]);
	StringOut(temp1,ROW4,LINE1+180,color,BFINALRESULT);

	StringOut("897.84~899.16",ROW1+50,LINE1+210,CAMBLUE,BFINALRESULT);
	StringOut("mb",ROW3+30,LINE1+210,CAMBLUE,BFINALRESULT);
	color=RED;
	if((g_nParameters[16]>=897.84)&&(g_nParameters[16]<=899.16))color=GREEN1;
	sprintf(temp1,"%6.1f",g_nParameters[16]);
	StringOut(temp1,ROW4,LINE1+210,color,BFINALRESULT);

	StringOut("11.84~12.24",ROW1+50,LINE1+240,CAMBLUE,BFINALRESULT);
	StringOut("$",ROW3+30,LINE1+240,CAMBLUE,BFINALRESULT);
	color=RED;
	if((g_nParameters[16]>=11.84)&&(g_nParameters[17]<=12.24))color=GREEN1;
	sprintf(temp1,"%6.1f",g_nParameters[17]);
	StringOut(temp1,ROW4,LINE1+240,color,BFINALRESULT);
	StringOut("RTN",RIGHT,LINE5,GREEN1,BFINALRESULT);
}
////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////
void MFLRAproc()
{	
	char temp1[10];
	int color=GREEN1;
	bool berr=false;
	
	StringOut("DATA",ROW1+50,LINE1+30,GREEN1,BFINALRESULT);
	StringOut("TEST RESULT",ROW4,LINE1+30,GREEN1,BFINALRESULT);

	StringOut("88~108",ROW1+50,LINE1+60,CAMBLUE,BFINALRESULT);
	StringOut("ft",ROW3+30,LINE1+60,CAMBLUE,BFINALRESULT);
	if((g_nParameters[11]<88)||(g_nParameters[11]>108))
	{
		color=RED;
		berr=true;
	}
	sprintf(temp1,"%d",g_nParameters[11]);
	StringOut(temp1,ROW4,LINE1+60,color,BFINALRESULT);
	StringOut("RTN",RIGHT,LINE5,GREEN1,BFINALRESULT);
	if(berr)
	{
		StringOut("RA ERR",ROW2+50,TOP,RED,BFINALRESULT|BIGFONT);///ADC OK
	}
	else
	{
		StringOut("RA OK",ROW2+50,TOP,GREEN1,BFINALRESULT|BIGFONT);///ADC OK
	}
}
////////////////////////////////////////////////////////////////////
void MFLTCNproc()
{	
	char temp1[10];
	int color=GREEN1;
	bool berr=false;
	float dis=(float)g_nParameters[12];
	
	StringOut("DATA",ROW1+50,LINE1+30,GREEN1,BFINALRESULT);
	StringOut("TEST RESULT",ROW4,LINE1+30,GREEN1,BFINALRESULT);
	StringOut("Azmluth",ROW1-50,LINE1+60,GREEN1,BFINALRESULT);
	StringOut("179~181",ROW1+50,LINE1+60,CAMBLUE,BFINALRESULT);
	StringOut("$",ROW3+30,LINE1+60,CAMBLUE,BFINALRESULT);
	if((g_nParameters[11]<179)||(g_nParameters[11]>181))
	{
		color=RED;
		berr=true;
	}
	sprintf(temp1,"%d",g_nParameters[11]);
	StringOut(temp1,ROW4,LINE1+60,color,BFINALRESULT);

	StringOut("DIS",ROW1-50,LINE1+100,GREEN1,BFINALRESULT);
	StringOut("-0.1~0.1",ROW1+50,LINE1+100,CAMBLUE,BFINALRESULT);
	StringOut("ft",ROW3+30,LINE1+100,CAMBLUE,BFINALRESULT);
	color=GREEN1;
/*	if((g_nParameters[12]<-0.1)||(g_nParameters[12]>0.1))
	{
		color=RED;
		berr=true;
	}*/
	sprintf(temp1,"%f",g_nParameters[12]);
	StringOut(temp1,ROW4,LINE1+100,color,BFINALRESULT);
	StringOut("RTN",RIGHT,LINE5,GREEN1,BFINALRESULT);
	if(berr)
	{
		StringOut("TCN ERR",ROW2+50,TOP,RED,BFINALRESULT|BIGFONT);///ADC OK
	}
	else
	{
		StringOut("TCN OK",ROW2+50,TOP,GREEN1,BFINALRESULT|BIGFONT);///ADC OK
	}
}
////////////////////////////////////////////////////////////////////
void MFLFCNAVproc(void)
{
	StringOut("MC",LEFT,LINE1,GREEN1,BFINALRESULT);
	StringOut("HUD",LEFT,LINE2,GREEN1,BFINALRESULT);
	StringOut("FMFD",LEFT,LINE3,GREEN1,BFINALRESULT);
	StringOut("LMFD",LEFT,LINE4,GREEN1,BFINALRESULT);
	StringOut("RFMD",LEFT,LINE5,GREEN1,BFINALRESULT);
	StringOut("CTVS",RIGHT,LINE1,GREEN1,BFINALRESULT);
	StringOut("DVDLR",RIGHT,LINE2,GREEN1,BFINALRESULT);
	StringOut("UFCP",RIGHT,LINE3,GREEN1,BFINALRESULT);

	RESproc(8,0x40,ROW1+20,LINE1);
	RESproc(8,0x4,ROW1+20,LINE2);
	RESproc(8,0x20,ROW1+20,LINE3);
	RESproc(8,0x10,ROW1+20,LINE4);
	RESproc(8,0x8,ROW1+20,LINE5);
	RESproc(8,0x2,ROW5,LINE1);
	RESproc(8,0x1,ROW5,LINE2);
	return;
}
//////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////
void MFLFMFDproc(void)
{	
	if((g_nParameters[8]&0x20)==0x20)
	StringOut("FMFD OK",ROW2+50,LINE1,GREEN1,BFINALRESULT|BIGFONT);
	else
	StringOut("FMFD ERR",ROW2+50,LINE1,RED,BFINALRESULT|BIGFONT);
	StringOut("HEATING BLOCK",LEFT+50,LINE2+30,GREEN1,BFINALRESULT);
	StringOut("COMMUNICATE BLOCK",LEFT+50,LINE2+60,GREEN1,BFINALRESULT);
	StringOut("BPS",LEFT+50,LINE2+90,GREEN1,BFINALRESULT);
	StringOut("LOW VOLTAGE POWER",LEFT+50,LINE2+120,GREEN1,BFINALRESULT);
	StringOut("COMMUNICATE CONTRAL BLOCK",LEFT+50,LINE2+150,GREEN1,BFINALRESULT);
	StringOut("VEDIO TRANSITION",LEFT+50,LINE2+180,GREEN1,BFINALRESULT);
	StringOut("KEY STATE",LEFT+50,LINE2+210,GREEN1,BFINALRESULT);
	StringOut("OK",ROW5,LINE2+30,GREEN1,BFINALRESULT);
	StringOut("RTN",RIGHT,LINE5,GREEN1,BFINALRESULT);
}
//////////////////////////////////////////////////////////////////////
void MFLproc(void)
{
	switch(g_nParameters[3])
	{
		case 0:		MFLMAINproc();break;
		case 23:	MFLADCproc();break;//MFLADC
		case 24:	MFLRAproc();break;//MFLRA
		case 25:	MFLTCNproc();break;//MFLRA
		case 22:	MFLFCNAVproc();break;//MFLFCNAVproc()
		case 61:	MFLFMFDproc();break;//MFLFMFDproc()
		default:	break;
	}
	return;

}
//////////////////////////////////////////////////////////////////////
void PFLproc(void)
{
	StringOut("PFL",(LEFT+ROW1)/2,TOP,YELLOW,BFINALRESULT);
	PutChar('@',RIGHT+10,LINE1,GREEN1,BFINALRESULT);
	PutChar('@',RIGHT+10,LINE2,GREEN1,!BFINALRESULT);
	Rotate(PI,RIGHT+15,LINE2+5);
	StringOut("ADC",ROW1,LINE1,RED,BFINALRESULT|BIGFONT);
	StringOut("FAIL",ROW4,LINE1,RED,BFINALRESULT|BIGFONT);
	StringOut("RA",ROW1,LINE2,RED,BFINALRESULT|BIGFONT);
	StringOut("FAIL",ROW4,LINE2,RED,BFINALRESULT|BIGFONT);
	StringOut("RSU",ROW1,LINE3,RED,BFINALRESULT|BIGFONT);
	StringOut("FAIL",ROW4,LINE3,RED,BFINALRESULT|BIGFONT);
	StringOut("FMFD-COM",ROW1,LINE4,RED,BFINALRESULT|BIGFONT);
	StringOut("FAIL",ROW4,LINE4,RED,BFINALRESULT|BIGFONT);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -