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

📄 3kmenu5.c

📁 嵌入式开发 嵌入式开发 嵌入式开发
💻 C
📖 第 1 页 / 共 5 页
字号:
/*********************
 Filename: 3KMENU5.C
 History&Datetime:
 DateTime: 2007-2-7 
 JOB-TODO: 通道点击的范围偏小 ,在menu5() 2095行将除纵向计算,纵/横向马达,调整系数,
 之外的鼠标点击范围放大为 Button + Edit 都可点击响应
 DateTime: 2007-3-20 16:27 
 JOB-TODO: 
*********************/
#include "ST3000.H"
#include "STRUC_3K.H"
#include "CORE_VGA.H"
#include "CORE_COM.H"
#include "3KDEFN.H"

static char *szptr_m5_1[][2] = {
    {"纵向计算值","V-CALUC"},
    {"纵向重复值","V-REPEAT"},
    {"纵向料长修正值","V-TUNE"},
    {"纵向设定值","V-SET"},
    {"纵向手动马达","V-MAN MOTOR"},
    {"横向重复值","H-REPEAT"},
    {"横向设定值","H-SET"},
    {"横向位置修正值","H-PLATE WIDTH"},
    {"横向行程","H-RANGE"},
    {"压辊直径","GEAR DIAM"},
    {"横向手动马达","H-MAN MOTOR"},
    {"调整系数","ADJ-MODUIUS"},
    {"系统机械参数", "SYS MACH PARAM"}
};

static char *str_preset[][2] = {
    {"参 数 一","PARAMETER ONE"},
    {"参 数 二","PARAMETER TWO"}
};

static char *szptr_okcancel[][2] = {
    {"确定","ENTER"},
    {"取消","CANCEL"}
};

static char  *szptr_pw_1[][2] = {
    {"X1坐标","X1 COOR"},
    {"Y1坐标", "Y1 COOR"},
    {"X3坐标","X3 COOR"},
    {"Y3坐标","Y3 COOR"},
    {"X5坐标","X5 COOR"},
    {"Y5坐标","Y5 COOR"},
    {"X6坐标","X6 COOR"},
    {"Y6坐标","Y6 COOR"},
    {"摆臂夹角","PUTARM ANGLE"},
    {"导向辊d1","LEAD DIAM1"},
    {"导向辊d2","LEAD DIAM2"},
    {"导向辊d3","LEAD DIAM3"},
    {"摆臂L1","PUTARM LEN1"},
    {"摆臂L2","PUTARM LEN2"},
    {"常数","CONSTANT"},
    {"限位时料最长", "LIMIT LENGTH"},
    {"是","YES"},
    {"否","NO"}
};

static char  *szptr_pw_2[][2] = {
    {"X1坐标","X1 COOR"},
    {"Y1坐标", "Y1 COOR"},
    {"X5坐标","X5 COOR"},
    {"Y5坐标","Y5 COOR"},
    {"X6坐标","X6 COOR"},
    {"Y6坐标","Y6 COOR"},
    {"导向辊d1","LEAD DIAM1"},
    {"导向辊d2","LEAD DIAM2"},
    {"常数","CONSTANT"},
    {"限位时料最长","LIMIT LENGTH"},
    {"是","YES"},
    {"否","NO"}
};

int nCoefChoice;
    /* nCoefChoice=0 纵向调整系数; nCoefChoice=1 横向调整系数 */
int vNewUnitSEL5,vOldUnitSEL5;
int vNewPageSEL5,vOldPageSEL5;
unsigned char vItemSEL5;
unsigned char MotorFlags[MAXCNL_3K]={0};
    /* bit0=1 纵向电机运动; bit4=1 横向电机运动 */

const _tagMenuAttr MenuAttr={10, 88, 160, 40, 500, 650};
const _tagInstAttr InstAttr={100, 20, 35, 8};
const _tagSizeAttr SizeAttrB={80, 35};
const _tagSizeAttr SizeAttrE={150,35};
const _tagSizeAttr SizeConfig={350, 415};


/**************** extern variables ****************/

extern void REC_Version(void);
extern void _Query_jzCmdList(void);
extern int  REC_sub1com;
/******************************
 描述: 手动电机状态
******************************/
void MotorKey_M5(int i, int flag)
{
    int xv,yv,shape[6];
    xv=MenuAttr.sX+MenuAttr.tW+MenuAttr.bW+80;
    switch(i)
    {
    case 1: //circle
        yv=MenuAttr.sY+250;
        //Button(xv, yv, 100, 50, (flag?0x10:0x00), NULL, 192, 192, 192);
        Rect(xv, yv, 100, 50, (flag?1:0));//2007-4-12 10:58
        Circle(xv+50, yv+25, 15, 0, 0, 255);
        break;
    case 2: //up
        yv=MenuAttr.sY+180;
        //Button(xv, yv, 100, 50, (flag?0x10:0x00), NULL, 192, 192, 192);
        Rect(xv, yv, 100, 50, (flag?1:0));
        shape[0]=xv+30;
        shape[1]=yv+40;
        shape[2]=xv+50;
        shape[3]=yv+15;
        shape[4]=xv+70;
        shape[5]=yv+40;
        FillPoly(3, shape, 0, 255, 0);
        break;
    case 3: //down
        yv=MenuAttr.sY+320;
        //Button(xv, yv, 100, 50, (flag?0x10:0x00), NULL, 192, 192, 192);
        Rect(xv, yv, 100, 50, (flag?1:0));
        shape[0]=xv+30;
        shape[1]=yv+10;
        shape[2]=xv+50;
        shape[3]=yv+35;
        shape[4]=xv+70;
        shape[5]=yv+10;
        FillPoly(3,shape,0,255,0);
        break;
    case 4: //left
        yv=MenuAttr.sY+320;
        //Button(xv, yv, 100, 50, (flag?0x10:0x00), NULL, 192, 192, 192);
        Rect(xv, yv, 100, 50, (flag?1:0));
        shape[0]=xv+35;
        shape[1]=yv+25;
        shape[2]=xv+65;
        shape[3]=yv+10;
        shape[4]=xv+65;
        shape[5]=yv+40;
        FillPoly(3,shape,0,255,0);
        break;
    case  5://right
        yv=MenuAttr.sY+180;
        //Button(xv, yv, 100, 50, (flag?0x10:0x00), NULL, 192, 192, 192);
        Rect(xv, yv, 100, 50, (flag?1:0));
        shape[0]=xv+35;
        shape[1]=yv+10;
        shape[2]=xv+35;
        shape[3]=yv+40;
        shape[4]=xv+65;
        shape[5]=yv+25;
        FillPoly(3,shape,0,255,0);
        break;
    default:
        break;
    }
}

/*
void ___Process4MachParaPage___(void)
*/
/******************************
 描述: 预套准参数标准1
******************************/
void SubM5_Fr13A(void)
{
    int i;
    int tmpnewx=MenuAttr.sX+MenuAttr.tW+5;
    int tmpnewy=MenuAttr.sY+80;
    unsigned char szChar[10]={0},tSTL=(VarST3000.Language ? 0x81 : 0x03);
    for(i=0; i<16; i++)
    {
        if( i<8 )
        {   Button(tmpnewx, tmpnewy+i*45, 120, 35, tSTL, szptr_pw_1[i][VarST3000.Language], 192, 192, 192);}
        else
        {   Button(tmpnewx+250, tmpnewy+(i-8)*45, 120, 35, tSTL, szptr_pw_1[i][VarST3000.Language], 192, 192, 192);}
    }
    if( Str6xtcs.flag==1 )
    {   Button(tmpnewx+380, tmpnewy+7*45, 100, 35, (tSTL|0x10), szptr_pw_1[16][VarST3000.Language], 192, 192, 192);}
    else
    {   Button(tmpnewx+380, tmpnewy+7*45, 100, 35, tSTL, szptr_pw_1[17][VarST3000.Language], 192, 192, 192);}
    /*
    对应的参数内容显示
    */
    vItemSEL5=1; /* 将X1坐标作为默认选择 */
    tSTL=0x05; /* 作为编辑框的显示风格 */
    /* 左侧栏包含内容: x1,y1; x3,y3; x5,y5; x6,y6 */
    sprintf(szChar, "%6.1f", Str6xtcs.x1);
    Edit(tmpnewx+130, tmpnewy+0*45, 100, 35, (tSTL|0x40), szChar); // 选中
    sprintf(szChar, "%6.1f", Str6xtcs.y1);
    Edit(tmpnewx+130, tmpnewy+1*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.x3);
    Edit(tmpnewx+130, tmpnewy+2*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.y3);
    Edit(tmpnewx+130, tmpnewy+3*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.x5);
    Edit(tmpnewx+130, tmpnewy+4*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.y5);
    Edit(tmpnewx+130, tmpnewy+5*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.x6);
    Edit(tmpnewx+130, tmpnewy+6*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.y6);
    Edit(tmpnewx+130, tmpnewy+7*45, 100, 35, tSTL, szChar);
    /* 右侧栏包含内容: a,d1,d2,d3,l1,l2,m */
    sprintf(szChar, "%6.1f", Str6xtcs.a);
    Edit(tmpnewx+380, tmpnewy+0*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.d1);
    Edit(tmpnewx+380, tmpnewy+1*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.d2);
    Edit(tmpnewx+380, tmpnewy+2*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.d3);
    Edit(tmpnewx+380, tmpnewy+3*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.l1);
    Edit(tmpnewx+380, tmpnewy+4*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.l2);
    Edit(tmpnewx+380, tmpnewy+5*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.m);
    Edit(tmpnewx+380, tmpnewy+6*45, 100, 35, tSTL, szChar);
    ClearKBuffer();
    g_Klength=6;
    g_Kmask=0x12; /* 输入有效数字6位 1位小数输入 */
}

/******************************
 描述: 预套准参数标准2
******************************/
void SubM5_Fr13B(void)
{
    int i;
    int tmpnewx=MenuAttr.sX+MenuAttr.tW+5;
    int tmpnewy=MenuAttr.sY+80;
    unsigned char szChar[10]={0},tSTL=(VarST3000.Language ? 0x81 : 0x03);
    for(i=0; i<10; i++)
    {
        if( i<5 )
        {   Button(tmpnewx, tmpnewy+i*45, 120, 35, tSTL, szptr_pw_2[i][VarST3000.Language], 192, 192, 192);}
        else
        {   Button(tmpnewx+250, tmpnewy+(i-5)*45, 120, 35, tSTL, szptr_pw_2[i][VarST3000.Language], 192, 192, 192);}
    }
    if( Str6xtcs.flag )
    {   Button(tmpnewx+380, tmpnewy+4*45, 100, 35, (tSTL|0x10), szptr_pw_1[16][VarST3000.Language], 192, 192, 192);}
    else
    {   Button(tmpnewx+380, tmpnewy+4*45, 100, 35, tSTL, szptr_pw_1[17][VarST3000.Language], 192, 192, 192);}
    /*
    对应的参数内容显示
    */
    vItemSEL5=1; /* 将X1坐标作为默认选择 */
    tSTL=0x05; /* 作为编辑框的显示风格 */
    /* 左侧栏包含内容: x1,y1; x5,y5; x6 */
    sprintf(szChar, "%6.1f", Str6xtcs.x1);
    Edit(tmpnewx+130, tmpnewy+0*45, 100, 35, tSTL|0x40, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.y1);
    Edit(tmpnewx+130, tmpnewy+1*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.x5);
    Edit(tmpnewx+130, tmpnewy+2*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.y5);
    Edit(tmpnewx+130, tmpnewy+3*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.x6);
    Edit(tmpnewx+130, tmpnewy+4*45, 100, 35, tSTL, szChar);
    /* 右侧栏包含内容: y6,d1,d3,m */
    sprintf(szChar, "%6.1f", Str6xtcs.y6);
    Edit(tmpnewx+380, tmpnewy+0*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.d1);
    Edit(tmpnewx+380, tmpnewy+1*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.d3);
    Edit(tmpnewx+380, tmpnewy+2*45, 100, 35, tSTL, szChar);
    sprintf(szChar, "%6.1f", Str6xtcs.m);
    Edit(tmpnewx+380, tmpnewy+3*45, 100, 35, tSTL, szChar);
    ClearKBuffer();
    g_Klength=6;
    g_Kmask=0x12; /* 输入有效数字6位 1位小数输入 */
}

/******************************
 描述: 预套准参数标准1和标准2的输入点选择
 参数:
    -Flags
        bit4=0表示标准1
        bit4=1表示标准2

        bit0=0表示失去光标
        bit0=1表示获得光标
    -Focus
        标准1 (1-15)
        标准2 (1-10)
******************************/
void SetFocus513(const unsigned char Flags, const unsigned char Focus)
{
    int tmpnewx=MenuAttr.sX+MenuAttr.tW+5;
    int tmpnewy=MenuAttr.sY+80;
    unsigned char szChar[10]={0},tSTL=0x05;
    if( Flags&0x01 ) {   tSTL|=0x40;}
    if( Flags&0x10 )
    {   // 机械参数结构二 [三角形调整结构]
        switch(Focus)
        {
        /* 左侧栏 */
        case 1: // x1
            sprintf(szChar, "%6.1f", Str6xtcs.x1);
            Edit(tmpnewx+130, tmpnewy+0*45, 100, 35, tSTL, szChar);
            break;
        case 2: // y1
            sprintf(szChar, "%6.1f", Str6xtcs.y1);
            Edit(tmpnewx+130, tmpnewy+1*45, 100, 35, tSTL, szChar);
            break;
        case 3: // x5
            sprintf(szChar, "%6.1f", Str6xtcs.x5);
            Edit(tmpnewx+130, tmpnewy+2*45, 100, 35, tSTL, szChar);
            break;
        case 4: // y5
            sprintf(szChar, "%6.1f", Str6xtcs.y5);
            Edit(tmpnewx+130, tmpnewy+3*45, 100, 35, tSTL, szChar);
            break;
        case 5: // x6
            sprintf(szChar, "%6.1f", Str6xtcs.x6);
            Edit(tmpnewx+130, tmpnewy+4*45, 100, 35, tSTL, szChar);
            break;
        /* 右侧栏 */
        case 6: // y6
            sprintf(szChar, "%6.1f", Str6xtcs.y6);
            Edit(tmpnewx+380, tmpnewy+0*45, 100, 35, tSTL, szChar);
            break;
        case 7: // d1
            sprintf(szChar, "%6.1f", Str6xtcs.d1);

⌨️ 快捷键说明

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