📄 1553analyzer3.pc
字号:
//else stop coolrunner and go to filter page
else {Csetcontent(ho4,"START");IOWrite(0x2907FFFE,0);//coolrunner stop!
f=1;}
Cdraw(ho4);
}
//Generate search keys from user's filter page inputs
formkeys()
{
showall=Cgetstate(h7);
if(!showall)
{
rt=Cgetcursel(h6);
rtkey=rt<<11;
tr=Cgetcursel(h3);//tr==2->"Both"
if(tr==2)both=1;
else both=0;
trkey=tr<<10;
sacount=0;
if(Cgetstate(h9)){sa[sacount]=0; sacount++;}
if(Cgetstate(h10)){sa[sacount]=1; sacount++;}
if(Cgetstate(h11)){sa[sacount]=2; sacount++;}
if(Cgetstate(h12)){sa[sacount]=3; sacount++;}
if(Cgetstate(h13)){sa[sacount]=4; sacount++;}
if(Cgetstate(h14)){sa[sacount]=5; sacount++;}
if(Cgetstate(h15)){sa[sacount]=6; sacount++;}
if(Cgetstate(h16)){sa[sacount]=7; sacount++;}
if(Cgetstate(h17)){sa[sacount]=8; sacount++;}
if(Cgetstate(h18)){sa[sacount]=9; sacount++;}
if(Cgetstate(h19)){sa[sacount]=10; sacount++;}
if(Cgetstate(h20)){sa[sacount]=11; sacount++;}
if(Cgetstate(h21)){sa[sacount]=12; sacount++;}
if(Cgetstate(h22)){sa[sacount]=13; sacount++;}
if(Cgetstate(h23)){sa[sacount]=14; sacount++;}
if(Cgetstate(h24)){sa[sacount]=15; sacount++;}
if(Cgetstate(h25)){sa[sacount]=16; sacount++;}
if(Cgetstate(h26)){sa[sacount]=17; sacount++;}
if(Cgetstate(h27)){sa[sacount]=18; sacount++;}
if(Cgetstate(h28)){sa[sacount]=19; sacount++;}
if(Cgetstate(h29)){sa[sacount]=20; sacount++;}
if(Cgetstate(h30)){sa[sacount]=21; sacount++;}
if(Cgetstate(h31)){sa[sacount]=22; sacount++;}
if(Cgetstate(h32)){sa[sacount]=23; sacount++;}
if(Cgetstate(h33)){sa[sacount]=24; sacount++;}
if(Cgetstate(h34)){sa[sacount]=25; sacount++;}
if(Cgetstate(h35)){sa[sacount]=26; sacount++;}
if(Cgetstate(h36)){sa[sacount]=27; sacount++;}
if(Cgetstate(h37)){sa[sacount]=28; sacount++;}
if(Cgetstate(h38)){sa[sacount]=29; sacount++;}
if(Cgetstate(h39)){sa[sacount]=30; sacount++;}
if(Cgetstate(h40)){sa[sacount]=31; sacount++;}
for(i=0;i<sacount;i++)
sakeys[i]=sa[i]<<5;
}
}
//Search SRAM forward for matches
searchForward()
{
int z;
string zs;
findcount=0;
mbi=0;
if(!showall)
{
rect(1,40,40,125,125,1);
text(60,76,"SEARCHING");
textattr(7,0,0);
}
for(si=v;si<last_record_locn;si=si+0x48)//search forward thru gathered records
{
if(findcount==1){v=si;break;} //find one, save place, its over Johnny
w=IORead(si+4);//read in command word
if(!showall)
{
if((w&rtmask)==rtkey)
{
if(both)
{
if(sacount)//if one or more sa's were selected
{
for(i=0;i<sacount;i++)
{
if((w&samask)==sakeys[i])
{
findcount++;
mb[mbi]=rt;//rt
mb[mbi+1]=(w&trmask)/0x0300;// t/r
mb[mbi+2]=sa[i];// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(mb[mbi+1])//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
for(j=2;j<(2+mb[mbi+3]);j++)
{mb[mbi+6+(j-2)]=IORead(si+4+(2*j));} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
// mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
// mb[mbi+5]=mb[mbi+5]+ts;
break; //go to next message in sram
}
}
}
else //no sa's were selected, so show any
{
findcount++;
mb[mbi]=rt;//rt
mb[mbi+1]=(w&trmask)/0x0300;// t/r
mb[mbi+2]=(w&samask)/0x0020;// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(mb[mbi+1])//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
for(j=2;j<(2+mb[mbi+3]);j++)
{mb[mbi+6+(j-2)]=IORead(si+4+(2*j));} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
// mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
// mb[mbi+5]=mb[mbi+5]+ts;
}
}
else if((w&trmask)==trkey)
{
// alert(sacount);
if(sacount)//if one or more sa's were selected
{
for(i=0;i<sacount;i++)
{
if((w&samask)==sakeys[i])
{
findcount++;
mb[mbi]=rt;//rt
mb[mbi+1]=tr;// t/r
mb[mbi+2]=sa[i];// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(tr)//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
for(j=2;j<(2+mb[mbi+3]);j++)
{mb[mbi+6+(j-2)]=IORead(si+4+(2*j));} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
// mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
// mb[mbi+5]=mb[mbi+5]+ts;
break; //go to next message in sram
}
}
}
else //no sa's were selected, so show any
{
findcount++;
mb[mbi]=rt;//rt
mb[mbi+1]=tr;// t/r
mb[mbi+2]=(w&samask)/0x0020;// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(tr)//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
for(j=2;j<(2+mb[mbi+3]);j++)
{mb[mbi+6+(j-2)]=IORead(si+4+(2*j));} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
// mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
// mb[mbi+5]=mb[mbi+5]+ts;
}
}
}
}
else //its "Show All", no keys used
{
findcount++;
mb[mbi]=(w&rtmask)/0x0800;//rt
mb[mbi+1]=(w&trmask)/0x0300;// t/r
mb[mbi+2]=(w&samask)/0x0020;// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(mb[mbi+1])//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
z=2+mb[mbi+3];
for(j=2;j<z;j++)
{
mb[mbi+6+(j-2)]=IORead(si+4+(2*j));
} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
//mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
//mb[mbi+5]=mb[mbi+5]+ts;
}
}
}
//Search SRAM backward for matches
searchBackward()
{
int z;
string zs;
findcount=0;
mbi=0;
if(!showall)
{
rect(1,40,40,125,125,1);
text(60,76,"SEARCHING");
textattr(7,0,0);
}
for(si=v;si>=0x29000000;si=si-0x48)
{
if(findcount==1){v=si;break;} //find one, save place, its over Johnny
w=IORead(si+4);//read in command word
if(!showall)
{
if((w&rtmask)==rtkey)
{
if(both)
{
if(sacount)//if one or more sa's were selected
{
for(i=0;i<sacount;i++)
{
if((w&samask)==sakeys[i])
{
findcount++;
mb[mbi]=rt;//rt
mb[mbi+1]=(w&trmask)/0x0300;// t/r
mb[mbi+2]=sa[i];// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(mb[mbi+1])//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
for(j=2;j<(2+mb[mbi+3]);j++)
{mb[mbi+6+(j-2)]=IORead(si+4+(2*j));} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
//mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
//mb[mbi+5]=mb[mbi+5]+ts;
break; //go to next message in sram
}
}
}
else //no sa's were selected, so show any
{
findcount++;
mb[mbi]=rt;//rt
// mb[mbi+1]=tr;// t/r
mb[mbi+1]=(w&trmask)/0x0300;// t/r
mb[mbi+2]=(w&samask)/0x0020;// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(mb[mbi+1])//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
for(j=2;j<(2+mb[mbi+3]);j++)
{mb[mbi+6+(j-2)]=IORead(si+4+(2*j));} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
//mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
//mb[mbi+5]=mb[mbi+5]+ts;
}
}
else if((w&trmask)==trkey)
{
// alert(sacount);
if(sacount)//if one or more sa's were selected
{
for(i=0;i<sacount;i++)
{
if((w&samask)==sakeys[i])
{
findcount++;
mb[mbi]=rt;//rt
mb[mbi+1]=tr;// t/r
mb[mbi+2]=sa[i];// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(tr)//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
for(j=2;j<(2+mb[mbi+3]);j++)
{mb[mbi+6+(j-2)]=IORead(si+4+(2*j));} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
//mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
//mb[mbi+5]=mb[mbi+5]+ts;
break; //go to next message in sram
}
}
}
else //no sa's were selected, so show any
{
findcount++;
mb[mbi]=rt;//rt
mb[mbi+1]=tr;// t/r
mb[mbi+2]=(w&samask)/0x0020;// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(tr)//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
for(j=2;j<(2+mb[mbi+3]);j++)
{mb[mbi+6+(j-2)]=IORead(si+4+(2*j));} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
//mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
//mb[mbi+5]=mb[mbi+5]+ts;
}
}
}
}
else //its "Show All", no keys used
{
findcount++;
mb[mbi]=(w&rtmask)/0x0800;//rt
mb[mbi+1]=(w&trmask)/0x0300;// t/r
mb[mbi+2]=(w&samask)/0x0020;// s/a
mb[mbi+3]=(w&wcmask); //wordcount
if(mb[mbi+3]==0)mb[mbi+3]=32;//wc = 0 means 32 words of data
if(mb[mbi+1])//it is a transmit command
{
mb[mbi+4]=IORead(si+6); //status word
z=2+mb[mbi+3];
for(j=2;j<z;j++)
{
mb[mbi+6+(j-2)]=IORead(si+4+(2*j));
} //data words if any
for(;(6+(j-2))<38;j++)mb[mbi+6+(j-2)]=0;//zero fill unused data words if any
}
else //it is a receive command
{
for(j=1;j<(1+mb[mbi+3]);j++)
{mb[mbi+6+(j-1)]=IORead(si+4+(2*j));} //data words if any
mb[mbi+4]=IORead(si+4+(2*j));//status word
for(;(6+(j-1))<38;j++)mb[mbi+6+(j-1)]=0;//zero fill unused data words if any
}
mb[mbi+5]=IORead(si);//time stamp
//mb[mbi+5]=mb[mbi+5]<<16;
ts=IORead(si+2);//time stamp, word 2
ts=ts&0x00000001;
//mb[mbi+5]=mb[mbi+5]+ts;
}
}
}
//filter handlers
on_h1(){
}
on_h3(){
}
on_h4(){
}
on_h5(){
}
on_h6(){
}
on_h7(){
}
on_h8(){
}
on_h9(){
}
on_h10(){
}
on_h11(){
}
on_h12(){
}
on_h13(){
}
on_h14(){
}
on_h15(){
}
on_h16(){
}
on_h17(){
}
on_h18(){
}
on_h19(){
}
on_h20(){
}
on_h21(){
}
on_h22(){
}
on_h23(){
}
on_h24(){
}
on_h25(){
}
on_h26(){
}
on_h27(){
}
on_h28(){
}
on_h29(){
}
on_h30(){
}
on_h31(){
}
on_h32(){
}
on_h33(){
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -