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

📄 3kmenu2x.c

📁 嵌入式开发 嵌入式开发 嵌入式开发
💻 C
📖 第 1 页 / 共 5 页
字号:
/**********************
 Filename: 3KMENU2X.C
 DateTime: 2007-3-22 14:27
 JOB-TODO: 在RespEntireINTEL23v()函数整机智能修改为,按下后一次下发当前系的所有工作通道的6#命令
 JOB-TODO: RespINTEL23()函数
**********************/
#include "ST3000.H"
#include "STRUC_3K.H"
#include "CORE_VGA.H"
#include "CORE_COM.H"
#include "3KDEFN.H"
static char *szptr_leftright[][2] = {
    {"左移","LEFT"},
    {"右移","RIGHT"}
};

extern int addrpoint;
extern int UnitSEL,UnitSEL_Old;
extern unsigned RulerLength;
extern unsigned char ytzVSELa,ytzVSELb;
extern unsigned char ytzHSELa,ytzHSELb;
extern unsigned char MaxScale,Scaling;
extern unsigned char adresult,tcflag;
extern unsigned hWaveXms;
extern unsigned char trnSEL,mrkSEL;
extern unsigned char bFlagsINPUT22;

extern int GetJOB_ytz(const int jobID);
extern void SyncSimPSEL22(const unsigned char resetfocus);
/***
 上调节按键(波形界面和误差综合调节屏幕使用)
 参数:
    -x,y 起点坐标
    -evnt 事件
***/
void wjrUAdj323(const int x, const int y, const int evnt)
{
    int shape[14];
    shape[0] =x+7;
    shape[1] =y+17;
    shape[2] =x+7;
    shape[3] =y+23;
    shape[4] =x+43;
    shape[5] =y+23;
    shape[6] =x+43;
    shape[7] =y+17;
    shape[8] =x+49;
    shape[9] =y+17;
    shape[10]=x+25;
    shape[11]=y+2;
    shape[12]=x+1;
    shape[13]=y+17;
    switch(evnt)
    {
    case BES_HIDE:
        Bar(x, y, x+50, y+25, 192, 192, 192);
        break;
    case BES_SHOW:
        //Button(x, y, 50, 25, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 50, 25,0);
        FillPoly(7, shape, 128, 128, 64);
        break;
    case BES_LIMIT:
        //Button(x, y, 50, 25, 0x00, NULL, 192, 192, 192);2007-4-12 9:30
        Rect(x, y, 50, 25,0);
        FillPoly(7, shape, 0, 128, 255);
        break;
    case BES_PRESS:
        //Button(x, y, 50, 25, 0x10, NULL, 192, 192, 192);
        Rect(x, y, 50, 25,1);
        FillPoly(7, shape, 128, 128, 255);
        delay(15);
        //Button(x, y, 50, 25, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 50, 25,0);
        FillPoly(7, shape, 128, 128, 64);
        break;
    default:
        break;
    }
}

/******************************
 描述: 下调节按键(波形界面和误差综合调节屏幕使用)
 参数:
    -x,y    起点坐标
    -evnt   事件
******************************/
void wjrDAdj323(const int x, const int y, const int evnt)
{
    int shape[14];
    shape[0] =x+7;
    shape[1] =y+7;
    shape[2] =x+1;
    shape[3] =y+7;
    shape[4] =x+25;
    shape[5] =y+23;
    shape[6] =x+49;
    shape[7] =y+7;
    shape[8] =x+43;
    shape[9] =y+7;
    shape[10]=x+43;
    shape[11]=y+1;
    shape[12]=x+7;
    shape[13]=y+1;
    switch(evnt)
    {
    case BES_HIDE:
        Bar(x, y, x+50, y+25, 192, 192, 192);
        break;
    case BES_SHOW:
        //Button(x, y, 50, 25, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 50, 25,0);
        FillPoly(7, shape, 128, 128, 64);
        break;
    case BES_LIMIT:
        //Button(x, y, 50, 25, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 50, 25,0);
        FillPoly(7, shape, 0, 128, 255);
        break;
    case BES_PRESS:
        //Button(x, y, 50, 25, 0x10, NULL, 192, 192, 192);
        Rect(x, y, 50, 25,1);
        FillPoly(7, shape, 128, 128, 255);
        delay(15);
        //Button(x, y, 50, 25, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 50, 25,0);
        FillPoly(7, shape, 128, 128, 64);
        break;
    default:
        break;
    }
}

/******************************
 描述: 左调节按键(波形界面和误差综合调节屏幕使用)
 参数:
    -x,y 起点坐标
    -evnt 事件
******************************/
void wjrLAdj323(const int x, const int y, const int evnt)
{
    int shape[14];
    shape[0] =x+2;
    shape[1] =y+25;
    shape[2] =x+17;
    shape[3] =y+48;
    shape[4] =x+17;
    shape[5] =y+43;
    shape[6] =x+23;
    shape[7] =y+43;
    shape[8] =x+23;
    shape[9] =y+7;
    shape[10]=x+17;
    shape[11]=y+7;
    shape[12]=x+17;
    shape[13]=y+2;
    switch(evnt)
    {
    case BES_HIDE:
        Bar(x, y, x+25, y+50, 192, 192, 192);
        break;
    case BES_SHOW:
        //Button(x, y, 25, 50, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 25, 50,0);
        FillPoly(7, shape, 128, 128, 64);
        break;
    case BES_LIMIT:
        //Button(x, y, 25, 50, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 25, 50,0);
        FillPoly(7, shape, 0, 128, 255);
        break;
    case BES_PRESS:
        //Button(x, y, 25, 50, 0x10, NULL, 192, 192, 192);
        Rect(x, y, 25, 50,1);
        FillPoly(7, shape, 128, 128, 255);
        delay(15);
        //Button(x, y, 25, 50, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 25, 50,0);
        FillPoly(7, shape, 128, 128, 64);
        break;
    default:
        break;
    }
}

/******************************
 描述: 右调节按键(波形界面和误差综合调节屏幕使用)
 参数:
    -x,y 起点坐标
    -evnt 事件
******************************/
void wjrRAdj323(const int x, const int y, const int evnt)
{
    int shape[14];
    shape[0] =x+23;
    shape[1] =y+25;
    shape[2] =x+7;
    shape[3] =y+48;
    shape[4] =x+7;
    shape[5] =y+43;
    shape[6] =x+2;
    shape[7] =y+43;
    shape[8] =x+2;
    shape[9] =y+7;
    shape[10]=x+7;
    shape[11]=y+7;
    shape[12]=x+7;
    shape[13]=y+2;
    switch(evnt)
    {
    case BES_HIDE:
        Bar(x, y, x+25, y+50, 192, 192, 192);
        break;
    case BES_SHOW:
        //Button(x, y, 25, 50, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 25, 50,0);
        FillPoly(7, shape, 128, 128, 64);
        break;
    case BES_LIMIT:
        //Button(x, y, 25, 50, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 25, 50,0);
        FillPoly(7, shape, 0, 128, 255);
        break;
    case BES_PRESS:
        //Button(x, y, 25, 50, 0x10, NULL, 192, 192, 192);
        Rect(x, y, 25, 50,1);
        FillPoly(7, shape, 128, 128, 255);
        delay(15);
        //Button(x, y, 25, 50, 0x00, NULL, 192, 192, 192);
        Rect(x, y, 25, 50,0);
        FillPoly(7, shape, 128, 128, 64);
        break;
    default:
        break;
    }
}

/******************************
 描述:	刷新当前系选中通道的微调值显示
******************************/
//(1)纵向微调显示
void DispVAdj_M23(void)
{
    int  vXpt;
    char vSZ[10]={0};
    vXpt=AlrAdjBox_M23_X+AlrAdjBox_M23_W/2+28;
    Bar(vXpt, AlrAdjBox_M23_Y+4, AlrAdjBox_M23_X+AlrAdjBox_M23_W-2, AlrAdjBox_M23_Y+20, 192, 192, 192);
    sprintf(vSZ, "%6.2f", unit[UnitSEL-1].submenu1.v_adjust/100.0);
    ShowGB2312(vXpt+((AlrAdjBox_M23_W/2-30)-(int)strlen(vSZ)*16), AlrAdjBox_M23_Y+4, vSZ, 0, 0, 0);
}
//(2)横向微调显示
void DispHAdj_M23(void)
{
    int  vXpt;
    char hSZ[10]={0};
    vXpt=AlrAdjBox_M23_X+AlrAdjBox_M23_W/2+28;
    Bar(vXpt, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-20, AlrAdjBox_M23_X+AlrAdjBox_M23_W-2, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-4, 192, 192, 192);
    sprintf(hSZ, "%6.2f", unit[UnitSEL-1].submenu1.h_adjust/100.0);
    ShowGB2312(vXpt+((AlrAdjBox_M23_W/2-30)-(int)strlen(hSZ)*16), AlrAdjBox_M23_Y+AlrAdjBox_M23_H-20, hSZ, 0, 0, 0);
}

/******************************
 描述: 刷新当前系选中通道的误差修正框
******************************/
//(1)纵向误差
void DispVErr_M23(const int vDAT)
{
    int tAlarm,tError;
    unsigned char bFLAG=0,szChar[10]={0};
    int xcent=AlrAdjBox_M23_X+(AlrAdjBox_M23_W>>1);
    int ycent=AlrAdjBox_M23_Y+(AlrAdjBox_M23_H>>1);
    
    /*
    清除中心误差示意区域
    并刷新报警范围
    */    
	Bar(AlrAdjBox_M23_X+26, AlrAdjBox_M23_Y+26,
	    AlrAdjBox_M23_X+AlrAdjBox_M23_W-26, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-26, 192, 192, 192);    
	tAlarm=unit[UnitSEL-1].submenu1.v_alarm;
	if( tAlarm>=100 ) {   tAlarm=100;}
	Line(xcent-10, AlrAdjBox_M23_Y+26, xcent-10, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-26, 0, 0, 0);
	Line(xcent+10, AlrAdjBox_M23_Y+26, xcent+10, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-26, 255, 255, 255);
	Line(xcent-9, ycent-5-tAlarm, xcent+9, ycent-5-tAlarm, 0, 0, 0);
	Line(xcent-9, ycent+5+tAlarm, xcent+9, ycent+5+tAlarm, 0, 0, 0);
	
	
    /*
    更新误差在框内的显示
    */
    sprintf(szChar, "%6.2f", vDAT/100.0);
    if( abs(vDAT)>=abs(unit[UnitSEL-1].submenu1.v_alarm) )
    {   bFLAG|=0x01;}
    Bar(AlrAdjBox_M23_X+2, AlrAdjBox_M23_Y+4, xcent-28, AlrAdjBox_M23_Y+20, 192, 192, 192);
    if( vDAT>=100 ) {   tError=110;}
    else if( vDAT<=-110 ) {   tError=-110;}
    else {   tError=vDAT;}
    if( bFLAG&0x01 )
    {
        ShowGB2312(AlrAdjBox_M23_X+2, AlrAdjBox_M23_Y+4, szChar, 0, 0, 255);
        Bar(xcent-5, ycent-5-tError, xcent+5, ycent+5-tError, 0, 0, 255);
    }
    else
    {
        ShowGB2312(AlrAdjBox_M23_X+2, AlrAdjBox_M23_Y+4, szChar, 255, 0, 0);
        Bar(xcent-5, ycent-5-tError, xcent+5, ycent+5-tError, 0, 0, 0);
    }
}

//(2)纵横向误差
void DispHErr_M23(const int vDAT, const int hDAT)
{
    int tVAlarm,tHAlarm,tVError,tHError;
    int xcent=AlrAdjBox_M23_X+(AlrAdjBox_M23_W>>1);
    int ycent=AlrAdjBox_M23_Y+(AlrAdjBox_M23_H>>1);
    unsigned char bFLAG=0,szVert[10]={0},szHorz[10]={0};
        /* bFLAG; bit0=1 表示纵向报警; bit4=1 表示横向报警 */
    /*
    屏幕示意显示
    */
    
	Bar(AlrAdjBox_M23_X+26, AlrAdjBox_M23_Y+26,
	    AlrAdjBox_M23_X+AlrAdjBox_M23_W-26, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-26, 192, 192, 192);
	tVAlarm=unit[UnitSEL-1].submenu1.v_alarm;
	if( tVAlarm>=100 ) {   tVAlarm=100;}
	tHAlarm=unit[UnitSEL-1].submenu1.h_alarm;
	if( tHAlarm>=100 ) {   tHAlarm=100;}
	Line(AlrAdjBox_M23_X+26, ycent, AlrAdjBox_M23_X+AlrAdjBox_M23_W-26, ycent, 20, 20, 20);
	Line(xcent, AlrAdjBox_M23_Y+26, xcent, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-26, 20, 20, 20);
	Rectangle(xcent-5-tHAlarm, ycent-5-tVAlarm, xcent+5+tHAlarm, ycent+5+tVAlarm, 0, 0, 0);
    
    sprintf(szVert, "%6.2f", vDAT/100.0);
    if( abs(vDAT)>=abs(unit[UnitSEL-1].submenu1.v_alarm) )
    {   bFLAG|=0x01;}
    sprintf(szHorz, "%6.2f", hDAT/100.0);
    if( abs(hDAT)>=abs(unit[UnitSEL-1].submenu1.h_alarm) )
    {   bFLAG|=0x10;}
    Bar(AlrAdjBox_M23_X+2, AlrAdjBox_M23_Y+4, xcent-28, AlrAdjBox_M23_Y+20, 192, 192, 192);
    Bar(AlrAdjBox_M23_X+2, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-20, xcent-28, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-4, 192, 192, 192);
    if( vDAT>=110 ) {   tVError=110;}
    else if( vDAT<=-110 ) {   tVError=-110;}
    else {   tVError=vDAT;}
    if( hDAT>=110 ) {   tHError=110;}
    else if( hDAT<=-110 ) {   tHError=-110;}
    else {   tHError=hDAT;}    
    Bar(xcent-5+tHError, ycent-5-tVError, xcent+5+tHError, ycent+5-tVError, 0, 0, (bFLAG ? 255 : 0));
    if( bFLAG&0x01 )
    {   ShowGB2312(AlrAdjBox_M23_X+2, AlrAdjBox_M23_Y+4, szVert, 0, 0, 255);}
    else
    {   ShowGB2312(AlrAdjBox_M23_X+2, AlrAdjBox_M23_Y+4, szVert, 255, 0, 0);}
    if( bFLAG&0x10 )
    {   ShowGB2312(AlrAdjBox_M23_X+2, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-20, szHorz, 0, 0, 255);}
    else
    {   ShowGB2312(AlrAdjBox_M23_X+2, AlrAdjBox_M23_Y+AlrAdjBox_M23_H-20, szHorz, 255, 0, 0);}
	
} 
/******************************
 描述: 预套准参数标准选择按钮
 参数: bID按钮编号; bSTYLE按钮风格
******************************/
void hjYTZButton(const int bID, const unsigned char bSTYLE)
{
	int aID=0;
	char *szYTZVAL[][2]={
		{"重复值","REPEAT"},
		{"计算值","CALCU"},
		{"设定值","SETTING"}
	};
	_tagRectAttr rcTmp;
	rcTmp.x=810; rcTmp.y=150;
	rcTmp.w=100; rcTmp.h= 50;
	if(bID==1) { rcTmp.y=150; aID=0;}      //___纵向重复值
	else if(bID==2) { rcTmp.y=220; aID=1;} //___纵向计算值
	else if(bID==3) { rcTmp.y=290; aID=2;} //___纵向设定值
	else if(bID==4) { rcTmp.y=450; aID=0;} //___横向重复值
	else if(bID==5) { rcTmp.y=520; aID=2;} //___横向设定值
	Button(rcTmp.x, rcTmp.y, rcTmp.w, rcTmp.h,
		bSTYLE, szYTZVAL[aID][VarST3000.Language], 192, 192, 192);
}

/***
 波门地址刷新
***/
void DispGateAddr(void)
{
    char tSZ[10]={0};
    Bar(115, 402, 195, 447, 192, 192, 192);
    sprintf(tSZ, "%4d", unit[UnitSEL-1].submenu1.addressofwav);
    ShowGB2312(190-((int)GetBuffLen(tSZ)<<4), 416, tSZ, 0, 0, 0);
}

/***
 Z脉冲

⌨️ 快捷键说明

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