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

📄 handecontrol.txt

📁 ASC 信号机控制程序,国内最先进的信号机控制程序
💻 TXT
字号:
handremote() 
{
    unsigned int  xdata toto,toto1;
    unsigned char xdata i;

    if(sss!=co){
                hand_counter=0;
                }
    hand_counter++;
    if(hand_counter>100)hand_counter=100;
    if(co==(step_counter+1)){//强制当前相位
        if(hand_counter<4){
            lai_nouse=(now_step_schid-1)*98; //阶段表号
            lai_nouse=0x5242+lai_nouse;      //计算阶段表地址偏移量
            toto=lai_nouse;
            toto=toto+(step_counter)*3+2;    //当前阶段放行的相位
            lai_nouse=toto;
            toto1=XBYTE[toto];
            temp=toto1;
            toto1=toto1<<8;
            toto1=toto1+XBYTE[toto+1];     //当前阶段对应放行的相位
            lai=toto1;
            toto=0x5246+(now_step_schid-1)*98;
            tmd=toto;
            temp=XBYTE[toto];
            if(temp==0)toto=0x5001;       //通过阶段表中空白属
                  else toto=0x5122;       //性确认阶段表所依赖的相位表
            guli=toto;
            control_chunel=0;
            for(i=0;i<16;i++){
              if(i==0)shift=0x0001;
              if(i==1)shift=0x0002;
              if(i==2)shift=0x0004;
              if(i==3)shift=0x0008;
              if(i==4)shift=0x0010;
              if(i==5)shift=0x0020;
              if(i==6)shift=0x0040;
              if(i==7)shift=0x0080;
              if(i==8)shift=0x0100;
              if(i==9)shift=0x0200;
              if(i==10)shift=0x0400;
              if(i==11)shift=0x0800;
              if(i==12)shift=0x1000;
              if(i==13)shift=0x2000;
              if(i==14)shift=0x4000;
              if(i==15)shift=0x8000;        
              
              if((lai&shift)==shift){
                   hand_lamp=guli+i*18;    //相位对应的通道地址
                   hand_phase=XBYTE[hand_lamp]; //相位对应的通道高位字节
                   hand_phase=hand_phase<<8;
                   hand_phase=hand_phase+XBYTE[hand_lamp+1]; //相位对应通道的全部内容
                   control_chunel=control_chunel|hand_phase;
                                              }
                                }
           for(i=0;i<16;i++){
              if(i==0)shift=0x0001;
              if(i==1)shift=0x0002;
              if(i==2)shift=0x0004;
              if(i==3)shift=0x0008;
              if(i==4)shift=0x0010;
              if(i==5)shift=0x0020;
              if(i==6)shift=0x0040;
              if(i==7)shift=0x0080;
              if(i==8)shift=0x0100;
              if(i==9)shift=0x0200;
              if(i==10)shift=0x0400;
              if(i==11)shift=0x0800;
              if(i==12)shift=0x1000;
              if(i==13)shift=0x2000;
              if(i==14)shift=0x4000;
              if(i==15)shift=0x8000;   
            
              if((control_chunel&shift)==shift)lamp_state[i]=1;
                             }
                          }

   }else{ //强制的不是当前相位
       if(hand_counter<4){   //当前绿灯相位进入黄灯状态
            lai_nouse=(now_step_schid-1)*98; //阶段表号
            lai_nouse=0x5242+lai_nouse;      //计算阶段表地址偏移量
            toto=lai_nouse;
            toto=toto+(step_counter)*3+2;    //当前阶段放行的相位
            lai_nouse=toto;
            toto1=XBYTE[toto];
            temp=toto1;
            toto1=toto1<<8;
            toto1=toto1+XBYTE[toto+1];     //当前阶段对应放行的相位
            lai=toto1;
            toto=0x5246+(now_step_schid-1)*98;
            tmd=toto;
            temp=XBYTE[toto];
            if(temp==0)toto=0x5001;       //通过阶段表中空白属
                  else toto=0x5122;       //性确认阶段表所依赖的相位表
            temp=toto;
            control_chunel=0;
            for(i=0;i<16;i++){
               lai_nouse=0x0001;
               toto=(lai_nouse<<i);            //确认放行的灯组
               lai_nouse=toto;
              if((lai&toto)==lai_nouse){
                   hand_lamp=temp+i*18;    //相位对应的通道地址
                   hand_phase=XBYTE[hand_lamp]; //相位对应的通道高位字节
                   hand_phase=hand_phase<<8;
                   hand_phase=hand_phase+XBYTE[hand_lamp+1]; //相位对应通道的全部内容
                   control_chunel=control_chunel|hand_phase;
                                              }
                                }
           for(i=0;i<16;i++){
               toto=0x0001;
               toto=toto<<i;
               if(control_chunel&toto==toto)lamp_state[i]=3;
                             }
                   }
          if(hand_counter>4){
               for(i=0;i<16;i++){
                    toto=0x0001;
                    toto=toto<<i;
                    if(control_chunel&toto==toto)lamp_state[i]=4;
                             }
                             }
         }
 sss=co;
}

⌨️ 快捷键说明

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