📄 3kmenu2x.c
字号:
***/
void DrawZ(void)
{
int vINT=(1000*MaxScale - lineheader[UnitSEL-1])/Scaling;
if( vINT<=1000 )
{ Line(12+vINT, 467, 12+vINT, 670, 0, 0, 0);}
}
/***
波形刻度
***/
void DrawRuler(void)
{
int j=0,jmark=0;
Bar(4, 672, 1020, 682, 192, 192, 192);
for(jmark=0; j<1000; jmark++)
{
Line(12+j, 672, 12+j, 682, 0, 0, 0);
j=RulerLength*jmark/Scaling;
}
}
/***
显示当前通道的波门
***/
void DrawGate(void)
{
Bar(displaybar[UnitSEL-1], 468,
displaybar[UnitSEL-1]+displaywidth[UnitSEL-1]/Scaling, 668, 0, 255, 0);
}
/***
波形背景
***/
void DrawWAVbk(void)
{
#ifdef ST3000_SCRXMS
PutImage_xms(9, 467, 1006, 202, hWaveXms, 0);//2007-2-10 16:29
#else
Bar(9, 467, 1015, 670, 255, 255, 255);
#endif
}
/***
波形
***/
void DrawWAVfr(const int start)
{
int j,vpos=0;
vpos=start;
MoveTo(12, 566-(*(pdata1+vpos))*3/4);
for(j=0; j<1000*MaxScale && j<1000*Scaling; j+=Scaling)
{
LineTo(12+j/Scaling, 566-(*(pdata1+vpos))*3/4, 255, 0, 0);
if( vpos>=1000*MaxScale ) { vpos=(-1)*Scaling;}
vpos+=Scaling;
}
vpos=start;
MoveTo(12, 666-(*(pdata2+vpos))*3/4);
for(j=0; j<1000*MaxScale && j<1000*Scaling; j+=Scaling)
{
LineTo(12+j/Scaling, 666-(*(pdata2+vpos))*3/4, 255, 0, 0);
if( vpos>=1000*MaxScale ) { vpos=(-1)*Scaling;}
vpos+=Scaling;
}
Line(9, 568, 1015, 568, 0, 0, 255);
Line(9, 668, 1015, 668, 0, 0, 255);
}
/******************************
描述: 标记排列按钮显示
******************************/
void SetSTurnsBDISP_M22(const int bID, const unsigned char bSELECTED)
{
int x,y,aID;
char *szSTurns[][2]={
{"顺","FOR"},
{"逆","REV"},
{"单","SINGLE"}
};
unsigned char bSTYLE=(VarST3000.Language?0x81:0x03);
if(bSELECTED) { bSTYLE|=0x10;}
if(bID==1)
{ aID=0; x=545; y=190;} //___纵顺
else if(bID==2)
{ aID=1; x=545; y=270;} //___纵逆
else if(bID==3)
{ aID=2; x=545; y=510;} //___单标记
else if(bID==4)
{ aID=0; x=505; y=390;} //___横顺
else if(bID==5)
{ aID=1; x=580; y=390;} //___横逆
else return;
Button(x, y, 60, 60, bSTYLE, szSTurns[aID][VarST3000.Language], 192, 192, 192);
}
/******************************
描述: 设置波形界面左右调节按钮显示或者隐藏
******************************/
void SetLRAdjVIS_M23(const int vTYPE)
{
wjrLAdj323(AlrAdjBox_M23_X, AlrAdjBox_M23_Y+AlrAdjBox_M23_H/2-25, vTYPE);
wjrRAdj323(AlrAdjBox_M23_X+AlrAdjBox_M23_W-25, AlrAdjBox_M23_Y+AlrAdjBox_M23_H/2-25, vTYPE);
}
/******************************
描述: 色标按钮(全部弹起)
******************************/
void ShowAllShapeBTN(void)
{
_SyncShapeSEL(0,0);
_SyncShapeSEL(1,0);
_SyncShapeSEL(2,0);
_SyncShapeSEL(3,0);
_SyncShapeSEL(4,0);
_SyncShapeSEL(5,0);
_SyncShapeSEL(6,0);
}
/***
预套准选择依据内容栏标题
-ID
bitLower:4 0纵向 1横向
bitUpper:4 1纵向重复值 2纵向计算值 3纵向设定值 4横向重复值 5横向设定值
***/
void ytzSetTitle(const unsigned char ID)
{
char *sub3str_1[][2]={
{"纵向重复", "V-REPEAT"},
{"纵向计算", "V-COMPUTE"},
{"纵向设定", "V-SET"},
{"横向重复", "H-REPEAT"},
{"横向设定", "H-SET"}
};
int x=370,y=138,w=85,h=20;
if( ID>3 ) { x+=200;}
Bar(x, y, x+w, y+h, 192, 192, 192);
if( VarST3000.Language )
{ ShowASCMem(x+8, y+2, sub3str_1[ID-1][1], 0, 0, 0);}
else
{ ShowGB2312(x+8, y+2, sub3str_1[ID-1][0], 0, 0, 0);}
}
/******************************
描述: 开始停止预套准按钮的刷新
******************************/
void StartStop_button(const int vID, const unsigned char vSTYLE)
{
char *szptr_startstop[][2]={
{"开始","START"},
{"停止","STOP"}
};
if(vID==0)
{ Button(750, 630, 100, 50, vSTYLE, szptr_startstop[0][VarST3000.Language], 192, 192, 192);}
else //if(vID==1)
{ Button(870, 630, 100, 50, vSTYLE, szptr_startstop[1][VarST3000.Language], 192, 192, 192);}
}
/***
当系选择后更新系内预套准选择依据按钮
***/
void UpdateScr21(void)
{
float fVAL;
char tBuff[10]={0};
unsigned tCofBan;
int t,ytzState,ytzVSEL,ytzHSEL;
unsigned char bSTL,bSTL_Start,bSTL_Stop;
if( VarST3000.Language )
{ bSTL_Start=0x01; bSTL_Stop=0x01; bSTL=0x01;}
else
{ bSTL_Start=0x03; bSTL_Stop=0x03; bSTL=0x03;}
ytzState=GetJOB_ytz(VarST3000.jobAB);
if( ytzState==1 )
{ bSTL_Start|=0x04;} // 预套准已经开始
else if( ytzState==2 )
{ bSTL_Start|=0x04; bSTL_Stop|=0x04;} // 没有通道在该系
else
{ bSTL_Stop|=0x04;} // 有通道并且没有开始预套准
StartStop_button(0, bSTL_Start);
StartStop_button(1, bSTL_Stop);
// 更新参数按钮选择显示
if( VarST3000.jobAB==1 )
{ ytzVSEL=ytzVSELa; ytzHSEL=ytzHSELa; tCofBan=SysSet.CofBanA;}
else
{ ytzVSEL=ytzVSELb; ytzHSEL=ytzHSELb; tCofBan=SysSet.CofBanB;}
// 刷新纵向预套准标准依据按钮和数值显示
if( ytzVSEL==0 )
{
hjYTZButton(1, (bSTL|0x10)); // 纵向重复值按下
hjYTZButton(2, (bSTL)); // 纵向计算值未选
hjYTZButton(3, (bSTL)); // 纵向设定值未选
ytzSetTitle(1);
}
else if( ytzVSEL==1 )
{
hjYTZButton(1, (bSTL)); // 纵向重复值未选
hjYTZButton(2, (bSTL|0x10)); // 纵向计算值按下
hjYTZButton(3, (bSTL)); // 纵向设定值未选
ytzSetTitle(2);
}
else if( ytzVSEL==2 )
{
hjYTZButton(1, (bSTL)); // 纵向重复值未选
hjYTZButton(2, (bSTL)); // 纵向计算值未选
hjYTZButton(3, (bSTL|0x10)); // 纵向设定值按下
ytzSetTitle(3);
}
// 刷新横向预套准标准依据按钮和数值显示
if( ytzHSEL==0 )
{
hjYTZButton(4, (bSTL|0x10)); // 横向重复值选择
hjYTZButton(5, (bSTL)); // 横向设定值未选
ytzSetTitle(4);
}
else if( ytzHSEL==1 )
{
hjYTZButton(4, (bSTL)); // 横向重复值未选
hjYTZButton(5, (bSTL|0x10)); // 横向设定值选择
ytzSetTitle(5);
}
// 更新内容显示
for(t=1; t<VarST3000.UnitCounts; t++)
{
if( unit[t].submenu1.unitworksnum.i==VarST3000.jobAB &&
unit[t].submenu1.unitworksnum.j)
{ // 正常工作
Edit(270, 138+40*t, 85, 32, 0x00, NULL);
Edit(470, 138+40*t, 85, 32, 0x00, NULL);
// 纵向预套准依据
if( ytzVSEL==0 )
{ fVAL=unit[t].submenu6.VRepeatValue/100.0;}
else if( ytzVSEL==2 )
{ fVAL=unit[t].submenu6.VSetupValue/100.0;}
else if( ytzVSEL==1 )
{
fVAL=unit[t].submenu6.length/100.0+0.005;//2007-2-27 13:44
if( fVAL<50 ) { fVAL+=tCofBan/10.0;}
}
memset(tBuff, 0, 10);
sprintf(tBuff, "%8.2f", fVAL);
Edit(370, 138+40*t, 85, 32, 0x05, tBuff);
// 横向预套准依据
if( ytzHSEL==0 )
{ fVAL=unit[t].submenu6.HRepeatValue/100.0;}
else if( ytzHSEL==1 )
{ fVAL=(unit[t].submenu6.HSetupValue+unit[t].submenu6.HMaxValue)/100.0;}
memset(tBuff, 0, 10);
sprintf(tBuff, "%6.2f", fVAL);
Edit(570, 138+40*t, 85, 32, 0x05, tBuff);
}
else
{ // 灰底
Edit(270, 138+40*t, 85, 32, 0x80, NULL);
Edit(370, 138+40*t, 85, 32, 0x80, NULL);
Edit(470, 138+40*t, 85, 32, 0x80, NULL);
Edit(570, 138+40*t, 85, 32, 0x80, NULL);
}
}
}
/***
整机工作状态处理
***/
int GetEntireAuto(const int iSER)
{
int t,iret=0,tCountCU=0;
unsigned char bSTATUS=1; // 认为处于自动工作模式
switch( iSER )
{
case 1: // A系属
for(t=1; t<VarST3000.UnitCounts; t++)
{
if( unit[t].submenu1.unitworksnum.i==1 &&
unit[t].submenu1.unitworksnum.j )
{
tCountCU++;
bSTATUS&=unit[t].submenu1.bitfield.hand_auto;
if( unit[t].submenu1.bitfield.hcontrol )
{ bSTATUS&=unit[t].submenu1.bitfield.h_motorruning;}
}
}
if( tCountCU )
{
if( bSTATUS!=EntireStatus.EntireAuto_A )
{ iret=1; EntireStatus.EntireAuto_A=bSTATUS;}
}
else
{ EntireStatus.EntireAuto_A=0;}
break;
case 2: // B系属
for(t=1; t<VarST3000.UnitCounts; t++)
{
if( unit[t].submenu1.unitworksnum.i==2 &&
unit[t].submenu1.unitworksnum.j )
{
tCountCU++;
bSTATUS&=unit[t].submenu1.bitfield.hand_auto;
if( unit[t].submenu1.bitfield.hcontrol )
{ bSTATUS&=unit[t].submenu1.bitfield.h_motorruning;}
}
}
if( tCountCU )
{
if( bSTATUS!=EntireStatus.EntireAuto_B )
{ iret=1; EntireStatus.EntireAuto_B=bSTATUS;}
}
else
{ EntireStatus.EntireAuto_B=0;}
break;
default:
break;
}
return iret;
}
/***
判断是否是整系智能
***/
int GetEntireIntelligent(const int iSER)
{
int t,iret=0,tCountCU=0;
unsigned char bAPTITUDE=1; // 认为处于智能工作模式
switch( iSER )
{
case 1: // A系属
for(t=1; t<VarST3000.UnitCounts; t++)
{
if( unit[t].submenu1.unitworksnum.i==1 &&
unit[t].submenu1.unitworksnum.j )
{
tCountCU++;
bAPTITUDE&=unit[t].submenu1.bitfield.autowork;
}
}
if( tCountCU )
{
if( bAPTITUDE!=EntireStatus.EntireIntelligent_A )
{ iret=1; EntireStatus.EntireIntelligent_A=bAPTITUDE;}
}
else
{ EntireStatus.EntireIntelligent_A=0;}
break;
case 2: // B系属
for(t=1; t<VarST3000.UnitCounts; t++)
{
if( unit[t].submenu1.unitworksnum.i==2 &&
unit[t].submenu1.unitworksnum.j )
{
tCountCU++;
bAPTITUDE&=unit[t].submenu1.bitfield.autowork;
}
}
if( tCountCU )
{
if( bAPTITUDE!=EntireStatus.EntireIntelligent_B )
{ iret=1; EntireStatus.EntireIntelligent_B=bAPTITUDE;}
}
else
{ EntireStatus.EntireIntelligent_B=0;}
break;
default:
break;
}
return iret;
}
/***
同步色块状态
***/
void SetWrkMark23(const int iCNL, const int iSHOW)
{
if( iSHOW )
{
if( unit[iCNL].submenu1.bitfield.hcontrol )
{
if(unit[iCNL].submenu1.bitfield.hand_auto)
{
if( iCNL<7 )
{ Circle(235, 60+50*iCNL, 5, 128, 255, 128);}
else
{ Circle(355, 60+50*(iCNL-6), 5, 128, 255, 128);}
}
else
{
if( iCNL<7 )
{ Circle(235, 60+50*iCNL, 5, 0, 255, 255);}
else
{ Circle(355, 60+50*(iCNL-6), 5, 0, 255, 255);}
}
if( unit[iCNL].submenu1.bitfield.h_motorruning )
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -