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

📄 etushow.c

📁 以前做的泰国瓦楞纸板生产线监控系统
💻 C
字号:
#include "svgacc.h"
#include <dos.h>
#include <bios.h>
#include <stdio.h>
#include <conio.h>
#include <stdlib.h>
#include <io.h>
#include <time.h>
#include <string.h>
#define enter 13
#define esc 27
#define ESC 27
#define BACKSPACE 8
#define ENTER 13
#define kbF1 187
#define kbF2 188
#define kbF3 189
#define kbF4 190
#define kbF5 191
#define kbF6 192
#define kbF7 193

#define kbUp 200
#define kbDn 208
#define kbCtrlE 5
#define kbCtrlZ 26

#define BLACK 0
#define lBLUE 1
#define lGREEN 2
#define lCYAN 3
#define lRED 4
#define lPINK 5
#define lYELLOW 6
#define lWHITE 7
#define GRAY 8
#define BLUE 9
#define GREEN 10
#define CYAN 11
#define RED 12
#define PINK 13
#define YELLOW 14
#define WHITE 15
#define FALSE 0

static char ASCbuf[4096];
FILE *fpHZ;
void drwstr(char *s,int x,int y,int m,int n,int col,PixelMode mode);
int drwhzstr(char *s,int x,int y,int m,int n,int col,int mode);
void drwbutton(char *phstr,char *str,int x,int y,PixelMode i,int col11) ;
int getkey(void);

void main(void)
{ 
 char buf1[4];
 int ok;
 char j;
 FILE *fp;
 char *buf;
 buf=(char *)calloc(1,40);

 if ((fpHZ=fopen("hzk16","rb"))==NULL)
   { printf("open hzk16 error\n");
    exit(0);
    }
 if ((fp=fopen("asc16","rb"))==NULL)
    { printf("open file error");
    exit(1);
    }
 if (fgets(ASCbuf,4096,fp)==NULL)
    {
      printf("error");
      exit(1);
    }
 whichvga();
 res800();
 ok=0;
/* windows(0,0,800,600); */
/* 图头 */
 drwbox(SET,lPINK,0,0,800,600);
 drwbox(SET,lPINK,1,1,799,599);
 drwbox(SET,lPINK,2,2,798,598);
 drwfillbox(SET,BLACK,3,3,797,597);

 drwline(SET,lPINK,2,22,799,22);
 drwline(SET,lPINK,2,22,799,22);
 drwfillbox(SET,WHITE,3,3,798,21);
 strcpy(buf,"Production Management System : Web End Display");   
 drwstr(buf,5,3,1,1,lRED,SET);
 drwbox(SET,lYELLOW,5,25,795,80);
 drwbox(SET,lYELLOW,6,26,794,79);
 drwfillbox(SET,WHITE,7,27,793,78);

 strcpy(buf,"Hubei Jingshan Light Industrial Machinery Co., Ltd");
 drwstr(buf,180,38,1,1,RED,SET);

 drwbox(SET,RED,5,86,795,194);
 drwbox(SET,lCYAN,6,87,794,193);
 drwfillbox(SET,lBLUE,7,88,793,192);

 drwbox(SET,GREEN,9,90,575,190);
 drwbox(SET,GREEN,10,91,574,189);
 drwline(SET,GREEN,82,90,82,190);
 drwline(SET,GREEN,205,90,205,190);
 drwline(SET,GREEN,328,90,328,190);
 drwline(SET,GREEN,451,90,451,190);
 drwline(SET,GREEN,9,114,575,114);
 drwline(SET,GREEN,9,152,451,152);
 drwline(SET,GREEN,9,90,82,114);
 strcpy(buf,"Upper");
 drwstr(buf,26,125,1,1,WHITE,SET);
 strcpy(buf,"Lower");
 drwstr(buf,26,163,1,1,WHITE,SET);
 strcpy(buf,"Sheet Length");
 drwstr(buf,95,94,1,1,WHITE,SET);
 strcpy(buf,"Finished Qty");   
 drwstr(buf,218,94,1,1,WHITE,SET);
 strcpy(buf,"Unfinished Leng"); 
 drwstr(buf,329,94,1,1,WHITE,SET);
 strcpy(buf,"Lim-SP of D.F."); 
 drwstr(buf,455,94,1,1,WHITE,SET);

 drwbox(SET,GREEN,576,90,792,190);
 drwbox(SET,GREEN,576,91,791,189);
 drwfillbox(SET,BLACK,577,92,790,188);

 drwfillbox(SET,CYAN,9,200,72,220);
 strcpy(buf,"SN");
 drwfillbox(SET,CYAN,74,200,115,220);
 drwstr(buf,85,202,1,1,lPINK,SET);
 strcpy(buf,"OrdID");
 drwfillbox(SET,CYAN,117,200,169,220);
 drwstr(buf,122,202,1,1,lPINK,SET);
 
 
 drwfillbox(SET,RED,9,224,72,244);
 strcpy(buf,"Running");
 drwstr(buf,13,226,1,1,WHITE,SET);
 drwfillbox(SET,BLUE,9,250,72,270);
 strcpy(buf,"Pre-Run");
 drwstr(buf,13,252,1,1,WHITE,SET);
/*
 drwfillbox(SET,PINK,9,467,72,487);
 strcpy(buf,"Prepare");
 drwstr(buf,14,469,1,1,WHITE,SET);
*/ 
 strcpy(buf,"Paper");
 drwfillbox(SET,CYAN,171,200,475,220);
 drwstr(buf,322,202,1,1,lPINK,SET);
 strcpy(buf,"Total-Len");
 drwfillbox(SET,CYAN,477,200,550,220);
 drwstr(buf,478,202,1,1,lPINK,SET);
 
 strcpy(buf,"Width");
 drwfillbox(SET,CYAN,552,200,593,220);
 drwstr(buf,553,202,1,1,lPINK,SET);

 strcpy(buf,"Sect.");
 drwfillbox(SET,CYAN,595,200,636,220);
 drwstr(buf,596,202,1,1,lPINK,SET);
 
 strcpy(buf,"Leng.");
 drwfillbox(SET,CYAN,638,200,679,220);
 drwstr(buf,638,202,1,1,lPINK,SET);

 strcpy(buf,"Qty");
 drwfillbox(SET,CYAN,681,200,748,220);
 drwstr(buf,703,202,1,1,lPINK,SET);

 strcpy(buf,"LimSP");
 drwfillbox(SET,CYAN,750,200,791,220);
 drwstr(buf,751,202,1,1,lPINK,SET);

strcpy(buf1," ESC ");
strcpy(buf,"    EXIT   ");
drwbutton(buf1,buf,693,546,SET,lGREEN);

strcpy(buf1,"Up/Dn");
strcpy(buf,"Upper/Lower");
drwbutton(buf1,buf,693,495,SET,lGREEN);

 drwbox(SET,38,5,494,686,595);
 drwbox(SET,38,6,493,685,594);
 drwfillbox(SET,14,7,495,684,593);
 
 drwline(SET,38,5,522,684,522);
 drwline(SET,38,5,558,684,558);

 drwline(SET,38,77,493,77,594);             
 drwline(SET,38,229,493,229,594);
 drwline(SET,38,381,493,381,594);
 drwline(SET,38,533,493,533,594);

 strcpy(buf,"Model");
 drwstr(buf,22,500,1,1,38,SET);
 strcpy(buf,"Speed");
 drwstr(buf,21,532,1,1,38,SET);
 strcpy(buf,"Length");
 drwstr(buf,17,568,1,1,38,SET);

 strcpy(buf,"Ⅰ");
 drwhzstr(buf,200,500,1,1,BLACK,SET);
 strcpy(buf,"Single facer");
 drwstr(buf,96,500,1,1,38,SET);

 strcpy(buf,"Ⅱ");
 drwhzstr(buf,348,500,1,1,BLACK,SET);
 strcpy(buf,"Single facer");
 drwstr(buf,248,500,1,1,38,SET);
 
 strcpy(buf,"Ⅲ");
 drwhzstr(buf,498,500,1,1,BLACK,SET);
 strcpy(buf,"Single facer");
 drwstr(buf,398,500,1,1,38,SET);

/* strcpy(buf,"D");
 drwstr(buf,553,500,1,1,BLACK,SET);*/
 strcpy(buf,"Double facer");
 drwstr(buf,562,500,1,1,38,SET);





strcpy(buf,"eshow.pcx");
pcxmake(0,0,799,599,buf);
 
 while(!ok)
  {  
  while (kbhit())
     {j=(char)getkey();
      switch (j)
       {case esc:
	     ok=1;
	     break;
	     
	case enter:
	    ok=0;
	    break;
       }
     }
     sdelay(60);  
     _strtime(buf);
   } 
  
  fclose(fpHZ);
  restext(); 
 }

int getkey(void)
{ union REGS in,out;
  in.h.ah=0x8;
  int86(0x21,&in,&out);
  if(out.h.al==0)
   return getkey()+128;
  else
   return out.h.al;
}
void drwstr(char *s,int x,int y,int m,int n,
	  int col,PixelMode mode)
 { unsigned char dot[16][2];
   long offset1;
   register i,j,k,mm,nn,mask;

    while(*s)
     { offset1=(long)(*s)*16;
       s+=1;
       j=0;
       for(i=0;i<=15;i++)
	 { dot[i][j]=ASCbuf[offset1+i];
	   mask=0x80;
	   for(k=0;k<=7;k++)
	     {if (dot[i][j]&mask)
	       {for(nn=0;nn<n;nn++)
		 {for(mm=0;mm<m;mm++)
		  drwpoint(mode,col,x+(j*8+k)*n+nn,y+i*m+mm);
		 }
	       }
	       mask=mask>>1;
	      }
	 }
       x+=8*n;
     }
}
void drwbutton(char *phstr,char *str,int x,int y,PixelMode i,int col11)
{
  int k,j;
  int xn,yn;
  k=strlen(phstr);
  j=strlen(str);
  xn=x+j*8+10;
  yn=y+2+16+9+16+2;
  
drwline(i,7,x,y,xn,y);
drwline(i,7,x,y-1,xn+1,y-1);
drwline(i,7,x,y-2,xn+2,y-2);
drwline(i,7,x,y-2,x,yn);
drwline(i,7,x-1,y-2,x-1,yn+1);
drwline(i,7,x-2,y-2,x-2,yn+2);
drwline(i,0,xn+2,y-1,xn+2,yn+2);
drwline(i,0,xn+1,y,xn+1,yn+2);
drwline(i,0,xn,y+1,xn,yn+2);
drwline(i,0,x-1,yn+2,xn+2,yn+2);
drwline(i,0,x,yn+1,xn+2,yn+1);
drwline(i,0,x+1,yn,xn+2,yn);
drwfillbox(i,col11,x+1,y+1,xn-1,yn-1);
drwstr(phstr,x+(xn-x)/2-k*16/2,y+4,1,2,BLACK,i);                 /*x+(j*16)/2-(8*k)/2,y+2,1,1,0,i);*/
drwstr(str,x+5,y+2+16+5,1,1,RED,i);
}

int drwhzstr(char *s,int x,int y,int m,int n,int col,int mode)
 { unsigned char dot[16][2],qm,wm;
   long offset1;
   register i,j,k,mm,nn,mask;
   FILE *fpHZ;
 
   if((fpHZ=fopen("hzk16","rb"))==0)
     {printf("Error: HZK16 can't open.\n");
      return FALSE;
     }
  

    while(*s)
     { qm=(unsigned char)(s[0]-0xa1);
       s+=1;
       wm=(unsigned char)(s[0]-0xa1);

       offset1=((long)qm*94+(long)wm)*32;
       s+=1;
       fseek(fpHZ,offset1,SEEK_SET);
       for(i=0;i<=15;i++)
        {for(j=0;j<2;j++)
         { dot[i][j]=(unsigned char)fgetc(fpHZ);
           mask=0x80;
           for(k=0;k<=7;k++)
             {if (dot[i][j]&mask)
               {for(nn=0;nn<n;nn++)
                 {for(mm=0;mm<m;mm++)
                 drwpoint(mode,col,x+(j*8+k)*n+nn,y+i*m+mm);

                 }
               }
               mask=mask>>1;
              }
         }
        }
       x+=16*n;
     }
 fclose(fpHZ);
 }

⌨️ 快捷键说明

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