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

📄 menu_1.cpp

📁 吐血奉献:一套完整的DOS版软件工程
💻 CPP
📖 第 1 页 / 共 5 页
字号:
}
void yjdraline(float x1,float y1,float x2,float y2)
{
  int x0,y0,m1,n1,m2,n2;
  int XWide,YHigh;
  XWide=400;
  YHigh=336-8;
  if(spara.first_v<spara.end_v) x0=192+12;
  else x0=192+18;
  y0=400;
  m1=x0+floor(fabs((200)-x1)*XWide/1800);
  if((max/pow(10,max_num))>5){
   n1=y0-floor((y1*YHigh)/pow(10,max_num+1));}
  if((max/pow(10,max_num))<2.5)
   { n1=y0-floor((y1*YHigh)/(2.5*pow(10,max_num)));}
  if(((max/pow(10,max_num))>2.5)&&((max/pow(10,max_num))<5))
   { n1=y0-floor((y1*YHigh)/(5*pow(10,max_num)));}
  m2=x0+floor(fabs((200)-x2)*XWide/1800);
  if((max/pow(10,max_num))>5){
   n2=y0-floor((y2*YHigh)/pow(10,max_num+1));}
  if((max/pow(10,max_num))<2.5)
   { n2=y0-floor((y2*YHigh)/(2.5*pow(10,max_num)));}
  if((max/pow(10,max_num))>2.5&&(max/pow(10,max_num))<5)
   { n2=y0-floor((y2*YHigh)/(5*pow(10,max_num)));}
  setcolor(0);
  line(m1,n1,m2,n2);
}
void ivpeak()
{
 int i,j,l;
 float temp;
 i=1;con1=1;con2=1;
 if(ivp[1].current>ivp[2].current){
  con1=0;
  for(;;){
   do {
    if(i<count) i=i+1;
    else goto draln;
    temp=ivp[i+1].current+0.1;
   }while(ivp[i].current>temp);
   wb[con1].current=ivp[i].current;
   wb[con1].scan_v=ivp[i].scan_v;
   con1=con1+1;
 do {
    if(i<count) i=i+1;
    else goto draln;
     temp=ivp[i+1].current-0.1;
   }while(ivp[i].current>temp);
   wb[con1].current=ivp[i].current;
   wb[con1].scan_v=ivp[i].scan_v;
    con1=con1+1;
   do{
    if(i<count) i=i+1;
    else goto draln;
   }while(ivp[i].current<ivp[i+1].current);
   wp[con2].current=ivp[i].current;
   wp[con2].scan_v=ivp[i].scan_v;
   con2=con2+1;
  }
 }
 else{con2=0;con1=0;
  for(;;){
   do{
    if(i<count) i=i+1;
    else goto draln;
     temp=ivp[i+1].current+0.1;
   }while(ivp[i].current<temp);
   wp[con2].current=ivp[i].current;
   wp[con2].scan_v=ivp[i].scan_v;
   con2=con2+1;
   do {
    if(i<count) i=i+1;
    else goto draln;
     temp=ivp[i+1].current+0.1;
   }while(ivp[i].current>temp);
   wb[con1].current=ivp[i].current;
   wb[con1].scan_v=ivp[i].scan_v;
   con1=con1+1;
    do {
    if(i<count) i=i+1;
    else goto draln;
     temp=ivp[i+1].current-0.1;
   }while(ivp[i].current>temp);
   wb[con1].current=ivp[i].current;
   wb[con1].scan_v=ivp[i].scan_v;
   con1=con1+1;
  }
 }
 draln:for(i=1;i<con1-1;i=i+2){if(ivp[1].scan_v<ivp[2].scan_v){
				draline(wb[i].scan_v,wb[i].current,wb[i+1].scan_v,wb[i+1].current);}
			       else{
				yjdraline(wb[i].scan_v,wb[i].current,wb[i+1].scan_v,wb[i+1].current);}
       }
 }
void draline(float x1,float y1,float x2,float y2)
 {
  int x0,y0,m1,n1,m2,n2;
  int XWide,YHigh;
  XWide=400;
  YHigh=328;
  if(spara.first_v<spara.end_v) x0=204;
  else x0=210;
  y0=400;
  m1=x0+floor(fabs((-1600)-x1)*XWide/1800);
  if((max/pow(10,max_num))>5){
   n1=y0-floor((y1*YHigh)/pow(10,max_num+1));}
  if((max/pow(10,max_num))<2.5)
   { n1=y0-floor((y1*YHigh)/(2.5*pow(10,max_num)));}
  if((max/pow(10,max_num))>2.5&&(max/pow(10,max_num))<5.)
   { n1=y0-floor((y1*YHigh)/(5*pow(10,max_num)));}

  m2=x0+floor(fabs((-1600)-x2)*XWide/1800);
  if(max/(pow(10,max_num))>5)
   { n2=y0-floor((y2*YHigh)/pow(10,max_num+1)); }
  if((max/pow(10,max_num))<2.5)
   { n2=y0-floor((y2*YHigh)/(2.5*pow(10,max_num)));}
  if((max/pow(10,max_num))>2.5 && (max/pow(10,max_num))<5)
   { n2=y0-floor((y2*YHigh)/(5*pow(10,max_num)));}

  setcolor(0);
  line(m1,n1,m2,n2);
  return;
 }
float diffrance()
 {
 int i;
 for(i=0;i<1800;i++){ivd[i].current=0;ivd[i].scan_v=0;}
 for(i=1;i<count-1;i++){
  ivd[i].current=(ivp[i+1].current-ivp[i].current)/(ivp[i+1].scan_v-ivp[i].scan_v);
  ivd[i].scan_v=(ivp[i+1].scan_v+ivp[i].scan_v)/2;
  }
 return 0;
 }
void maxfind()
  {
  int i;
  float min1;
  max=fabs(ivd[1].current);
  min1=fabs(ivd[1].current);
  for(i=1;i<=count-2;i++)
    {
    if((fabs(ivd[i].current))<min1) min1=fabs(ivd[i].current);
    if((fabs(ivd[i].current))>max) max=fabs(ivd[i].current);
    }
  if(max==min1) max=1;
  return;
  }
void smjp()
  {
  int i,sel_R;
  int tq_time,jb_time;
  float step_v,temp[2]={0,0};
  char *spara_c_hz[5]={
	    "准备好按任意键",
	    "正在清洗",
	    "正在富集",
	    "溶液静止,请稍候",
	    "正在扫描,请稍候",
			 };
  cls_all_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(16,92,spara_c_hz[1],0);
  bell(400,1);
  outportb(0x220,0x08);
  da_v(spara.brush_v);
  outportb(0x220,0x18);
  if(watch(50,169,30,15,spara.brush_t)==283){
    cls_left_scrn();
    outportb(0x220,0x00);
    bell(400,0);
    return;
    }
  cls_left_scrn();
  bell(400,1);
  board(1,4,20,7,0,7);
  disp_shadow_str(16,92,spara_c_hz[2],0);
  outportb(0x220,0x08);
  da_v(spara.fuji_v);
  if(watch(50,169,30,15,spara.fuji_t)==283){
    cls_left_scrn();
    outportb(0x220,0x00);
    bell(400,0);
    return;
    }
  outportb(0x220,0x00);
  bell(400,1);
  cls_left_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(14,92,spara_c_hz[3],0);
  for(i=0;i<spara.stat_t;i++){
    if(kbhit()){
      if(bioskey(0)==283){
	cls_left_scrn();
	bell(400,0);
	return;
	}
      else break;
      }
    sleep(1);
    }
  sel_R=spara.sel_R;
  if(sel_R>15) sel_R=15;
  else if(sel_R<0) sel_R=0;
  count=1;
  ivp[count].insist=insist_set[sel_R];
  selinsist(sel_R);
  step_v=spara.slope;
  cls_left_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(14,92,spara_c_hz[4],0);
  bell(400,1);
  ivp[count].scan_v=spara.first_v;
  ivp[count].current=0.;
 do{
  ivp[count].current=0.0;
  delay(spara.t_width);
  ivp[count].current+=(-1)*ad_v();
  ivp[count].insist=insist_set[sel_R];
  ivp[count].current=(ivp[count].current)/ivp[count].insist*1E+5;
  if(count>4){
    temp[0]=ivp[count].current-ivp[count-1].current;
    temp[1]=ivp[count-1].current-ivp[count-2].current;
    if((temp[0]!=0)&&(temp[1]!=0))
      if((fabs(temp[0]/temp[1])>sz_sys.SM)||(fabs(temp[1]/temp[0])>sz_sys.SM))
	ivp[count].current=ivp[count-1].current;
    }
  count++;
  ivp[count].scan_v=ivp[count-1].scan_v+step_v;
  da_v(ivp[count].scan_v);
  if(kbhit()){
    if(bioskey(0)==283) break;
    else button("按ESC键返回!",0,0,1,0);
    }
  }while(ivp[count].scan_v < spara.end_v);
  bell(400,1);
  for(i=1;i<=10;i++)
    step_v+=ivp[i].current/10;
  for(i=1;i<=count;i++)
    ivp[i].current=ivp[i].current-step_v;
  da_v(spara.brush_v);
  outportb(0x220,0x00);
  for(i=0;i<6;i++){
    smooth();
    smooth1();
    }
  cls_all_scrn();
  maxfind1();
  board(1,4,16,7,0,7);
  if(sz_sys.IE==1) drascr(rate_flag,1,0);
  diffrance();
  maxfind();
  if(sz_sys.QD==1){
    board(1,4,16,7,0,7);
    diffdrascr();
    diffcalpeak();
    }
  return;
  }
void yjsmfa()
{
  int i,sel_R;
  int tq_time,jb_time;
  float step_v,temp[2]={0,0};
  char *spara_c_hz[5]={
	  "准备好按任意键",
	  "正在清洗",
	  "正在富集",
	  "溶液静止,请稍候",
	  "正在扫描,请稍候",
			 };
  cls_all_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(16,92,spara_c_hz[1],0);
  bell(400,1);
  da_v(spara.brush_v);
  outportb(0x220,0x18);
  if(watch(50,169,30,15,spara.brush_t)==283){
    cls_left_scrn();
    outportb(0x220,0x00);
    bell(400,0);
    return;
    }
  bell(400,1);
  outportb(0x220,0x08);
  cls_left_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(16,92,spara_c_hz[2],0);
  da_v(spara.fuji_v);
  if(watch(50,169,30,15,spara.fuji_t)==283){
    cls_left_scrn();
    outportb(0x220,0x00);
    bell(400,0);
    return;
    }
  outportb(0x220,0x00);
  cls_left_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(14,92,spara_c_hz[3],0);
  for(i=0;i<spara.stat_t;i++){
    if(kbhit()){
      if(bioskey(0)==283){
	cls_all_scrn();
	bell(400,0);
	return;
	}
      else break;
      }
    sleep(1);
    }
  sel_R=spara.sel_R;
  if(sel_R>15) sel_R=15;
  else if(sel_R<0) sel_R=0;
  count=1;
  step_v=spara.slope;
  ivp[count].scan_v=spara.first_v;
  ivp[count].insist=insist_set[sel_R];
  selinsist(sel_R);
  da_v(spara.first_v);
  cls_left_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(14,92,spara_c_hz[4],0);
  bell(400,1);
 do{
  ivp[count].current=0;
  delay(spara.t_width);
  ivp[count].current+=ad_v();
  ivp[count].insist=insist_set[sel_R];
  ivp[count].current=(ivp[count].current)/ivp[count].insist*1E+5;
  if(count>4){
    temp[0]=ivp[count].current-ivp[count-1].current;
    temp[1]=ivp[count-1].current-ivp[count-2].current;
    if((temp[0]!=0)&&(temp[1]!=0))
      if((fabs(temp[0]/temp[1])>sz_sys.SM)||(fabs(temp[1]/temp[0])>sz_sys.SM))
	ivp[count].current=ivp[count-1].current;
    }
  count++;
  ivp[count].scan_v=ivp[count-1].scan_v-step_v;
  da_v(ivp[count].scan_v);
  if(kbhit()){
    if(bioskey(0)==283) break;
    else button("按ESC键返回!",0,0,1,0);
    }
}while(ivp[count].scan_v>=spara.end_v);
da_v(spara.brush_v);
outportb(0x220,0x00);
for(i=0;i<6;i++){
  smooth();
  smooth1();
  }
cls_all_scrn();
maxfind1();
board(1,4,16,7,0,7);
if(sz_sys.IE==1) drascr(rate_flag,0,0);
diffrance();
maxfind();
if(sz_sys.QD==1){
  board(1,4,16,7,0,7);
  diffyjdrascr();
  diffyjcalpeak();
  }
return;
}
void xhfa()
  {
  int i,sel_R,judge=1;
  int tq_time,jb_time;
  float step_v,temp[2]={0,0};
  char *spara_c_hz[5]={
	    "准备好按任意键",
	    "正在清洗",
	    "正在富集",
	    "溶液静止,请稍候",
	    "正在扫描,请稍候",
			 };
  cls_all_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(16,92,spara_c_hz[1],0);
  bell(400,1);
  outportb(0x220,0x08);
  da_v(spara.brush_v);
  outportb(0x220,0x18);
  if(watch(50,169,30,15,spara.brush_t)==283){
    cls_left_scrn();
    outportb(0x220,0x00);
    bell(400,0);
    return;
    }
  cls_left_scrn();
  bell(400,1);
  board(1,4,20,7,0,7);
  disp_shadow_str(16,92,spara_c_hz[2],0);
  outportb(0x220,0x08);
  da_v(spara.fuji_v);
  if(watch(50,169,30,15,spara.fuji_t)==283){
    cls_left_scrn();
    outportb(0x220,0x00);
    bell(400,0);
    return;
    }
  outportb(0x220,0x00);
  bell(400,1);
  cls_left_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(14,92,spara_c_hz[3],0);
  for(i=0;i<spara.stat_t;i++){
     if(kbhit()){
      if(bioskey(0)==283){
	cls_left_scrn();
	bell(400,0);
	return;
	}
      else break;
      }
    sleep(1);
    }
  sel_R=spara.sel_R;
  if(sel_R>15) sel_R=15;
  else if(sel_R<0) sel_R=0;
  count=1;
  ivp[count].insist=insist_set[sel_R];
  selinsist(sel_R);
  step_v=spara.slope;
  cls_left_scrn();
  board(1,4,20,7,0,7);
  disp_shadow_str(14,92,spara_c_hz[4],0);
  bell(400,1);
  ivp[count].scan_v=spara.first_v;
  ivp[count].current=0.;
  if(spara.first_v<=spara.end_v) judge=1;
  else judge=-1;
 for(;;){
  ivp[count].current=0.0;
  delay(spara.t_width);
  ivp[count].current+=(-1)*ad_v();
  ivp[count].insist=insist_set[sel_R];
  ivp[count].current=ivp[count].current/ivp[count].insist*1E+5;
  if(count>4){
    temp[0]=ivp[count].current-ivp[count-1].current;
    temp[1]=ivp[count-1].current-ivp[count-2].current;
    if((temp[0]!=0)&&(temp[1]!=0))
      if((fabs(temp[0]/temp[1])>sz_sys.SM)||(fabs(temp[1]/temp[0])>sz_sys.SM))
	ivp[count].current=ivp[count-1].current;
    }
  count++;
  ivp[count].scan_v=ivp[count-1].scan_v+judge*step_v;
  da_v(ivp[count].scan_v);
  if(fabs(ivp[count].scan_v-spara.end_v)<=step_v) judge=(-1)*judge;
  if(ivp[count].scan_v==spara.first_v) break;
  if(kbhit()){
    if(bioskey(0)==283) break;
    else button("按ESC键返回!",0,0,1,0);
    }
  }
  bell(400,1);
  for(i=1;i<=10;i++)
    step_v+=ivp[i].current/10;
  for(i=1;i<=count;i++)
    ivp[i].current=ivp[i].current-step_v;
  da_v(spara.brush_v);
  outportb(0x220,0x00);
  for(i=0;i<6;i++){
    smooth();
    smooth1();
    }
  cls_all_scrn();
  maxfind1();
  board(1,4,16,7,0,7);
  if(sz_sys.IE==1) drascr(rate_flag,1,0);
  return;
  }
void secday(int secend)
  {
  int i=0;
  for(i=0;i<secend;i++){
    if(kbhit()) break;
    delay(1);
    }
  }
void xtzj()
{
  int t,i,sel_R,scanv;
  float inv[11],temp[2]={0,0};
  int key=0;
  char *spara_c_hz[2]={
			"系统正在工作",
			"扫描电位",
			 };
  if(spara.first_v>=spara.end_v){
    file_warn(5);
    return;
    }
  cls_all_scrn();

⌨️ 快捷键说明

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