您好,欢迎访问三七文档
当前位置:首页 > 幼儿/小学教育 > 幼儿教育 > 小班故事教案爱玩的小鸡
1.时间表调度实验#includebconstant.hexternC_declspec(dllexport)voidinitSchTable(intScheduleTable[SchTabLen][SchTabWdh]){inti,j;for(i=0;iSchTabLen;i++)for(j=0;jSchTabWdh;j++){if(j==1)//脉冲检测{ScheduleTable[i][j]=1;}if((i==0)&&(j==0))//摘挂机检测ScheduleTable[i][j]=1;if(((i==0)||(i==10))&&(j==2))//位间隔检测{ScheduleTable[i][j]=1;}}return;}2.摘挂机检测实验#includebconstant.hexternC_declspec(dllexport)voidscanfor200(intlinestate200[LINEMAX],intlinestate[LINEMAX],UpOnnode*head1,UpOnnode*end1){boolresult_up,result_down;inti;for(i=0;iLINEMAX;i++){result_up=(linestate200[i]-1)&&linestate[i];//摘机检测if(result_up==1)//摘机程序{end1-next=newUpOnnode;end1=end1-next;end1-phonestate=ehandup;end1-linenum=i;end1-next=0;}else{result_down=linestate200[i]&&(linestate[i]-1);//挂机检测if(result_down==1)//挂机程序{end1-next=newUpOnnode;end1=end1-next;end1-phonestate=ehandon;end1-linenum=i;end1-next=0;}}}for(i=0;iLINEMAX;i++)linestate200[i]=linestate[i];return;}//此函数不需修改externC_declspec(dllexport)voidfreenode(UpOnnode*node){deletenode;}3.脉冲计数实验#includebconstant.hintnor_op(inta,intb);intor_op(inta,intb);externC_declspec(dllexport)voidscanpulse(intlinestate[LINEMAX],intlinestate10[LINEMAX],intchange[LINEMAX],intfchange[LINEMAX],intpulsenum[LINEMAX]){inti;for(i=0;iLINEMAX;i++){change[i]=nor_op(linestate[i],linestate10[i]);//变化检测fchange[i]=or_op(fchange[i],change[i]);//首次变化if(change[i]&&linestate[i]){pulsenum[i]++;}}for(i=0;iLINEMAX;i++)linestate10[i]=linestate[i];return;}//此函数不需要修改intnor_op(inta,intb){if(a==b)return0;elsereturn1;}//此函数不需要修改intor_op(inta,intb){if((a==0)&&(b==0))return0;elsereturn1;}4.位间隔识别实验#includestdio.h#includebconstant.hintnor_yu(inta,intb);intor_yu(inta,intb);intnot_yu(inta);intand_yu(inta,intb);externC_declspec(dllexport)voidscandigit(intlinestate[LINEMAX],intlinestate100[LINEMAX],intpulsenum[LINEMAX],intfchange[LINEMAX],intlfchange[LINEMAX],Digitnode*head2,Digitnode*end2){inti;for(i=0;iLINEMAX;i++){if(and_yu(not_yu(fchange[i]),lfchange[i])==1){if(linestate100[i]==1){end2-next=newDigitnode;end2=end2-next;end2-num=pulsenum[i];end2-linenum=i;end2-next=0;pulsenum[i]=0;//线路脉值清零}else{//是挂机引起的不用处理}}else{//下一线路}}for(i=0;iLINEMAX;i++){lfchange[i]=fchange[i];fchange[i]=0;linestate100[i]=linestate[i];}return;}//此函数不需要修改externC_declspec(dllexport)voidfreedigitnode(Digitnode*b){deleteb;}//此函数不需要修改intnor_yu(inta,intb){if(a==b)return0;elsereturn1;}//此函数不需要修改intor_yu(inta,intb){if((a==0)&&(b==0))return0;elsereturn1;}intnot_yu(inta){if(a==1)return0;elsereturn1;return0;}intand_yu(inta,intb){if((a==b)&&(a==1))return1;elsereturn0;return0;}5.软件送音实验#includebconstant.hexternC_declspec(dllexport)intdecide_ringtype(Userstatestate){//1:拨号音;2:振铃音;3:回铃音;4:忙音;5:嚎鸣音;6:空号音;switch(state){case0:return1;//主叫摘机case1:return4;//被叫忙case2:return4;//通话中对方先挂机case3:return4;//拨号音超时case4:return4;//收号定时器超时case5:return4;//连接定时器超时case6:return4;//空号音超时case7:return4;//回铃音定时器超时case8:return5;//忙音超时case9:return6;//被叫空号case10:return2;//(被叫)呼叫进入case11:return3;//(主叫)被叫接通break;}return0;}6.驱动交换网络实验#includebconstant.hexternC_declspec(dllexport)voidconnect_network(inttimeslice_tnet[TIMESLICEMAX],inttimeslice1,inttimeslice2,inttag){if(tag==0)//tag=0表示拆除网络。{timeslice_tnet[timeslice1]=0;timeslice_tnet[timeslice2]=0;}else{timeslice_tnet[timeslice1]=timeslice2;timeslice_tnet[timeslice2]=timeslice1;}return;}
本文标题:小班故事教案爱玩的小鸡
链接地址:https://www.777doc.com/doc-6269951 .html