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

📄 1553analyzer3.pc

📁 xilinx reference design for 1553B BUS analyer using
💻 PC
📖 第 1 页 / 共 3 页
字号:
}
on_h34(){
}
on_h35(){
}
on_h36(){
}
on_h37(){
}
on_h38(){
}
on_h39(){
}
on_h40(){
}
//"Display" button
on_h41(){
string temp="Record Number ";
int record_number;
//form search keys
formkeys();
//search and buffer
v=0x29000000;
//Get the location of the last record gathered
last_record_locn=IORead(0x2907FFFC);

//TEMP REMOVE
last_record_locn=0x2907FFB8;
//END TEMP

searchForward();
clearg();
fdrawcontrols();

record_number=(v-0x29000000)/0x48;
temp=temp+record_number;
alert(temp);

if(!findcount)
  {
  alert("Not Found");
  }
else
  {
  //go on to display page
  if(showall)v=0x29000000;
  mf=3;
  f=1;
  }
}
//Update the Data in the Display 
updateFullDisplay()
{
string sd;
int r;
sd=mb[0];
if(mb[1])sd=sd+"T";
else sd=sd+"R";
sd=sd+mb[2];
Csetcontent(hdf4,sd);
Cdraw(hdf4);
sd=mb[3];
Csetcontent(hdf6,sd);
Cdraw(hdf6);
sd=hex(mb[4]);
//sd=hex(ts);     //TEMP DISP BIT 0 OF TIME STAMP WORD 2
sd=strright(sd,4);
Csetcontent(hdf8,sd);
Cdraw(hdf8);
sd=mb[5];
Csetcontent(hdf10,sd);
Cdraw(hdf10);
r=6;
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf11,sd);Cdraw(hdf11);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf12,sd); Cdraw(hdf12);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf13,sd); Cdraw(hdf13);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf14,sd); Cdraw(hdf14);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf16,sd); Cdraw(hdf16);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf17,sd); Cdraw(hdf17);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf18,sd); Cdraw(hdf18);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf19,sd); Cdraw(hdf19);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf20,sd); Cdraw(hdf20);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf21,sd); Cdraw(hdf21);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf22,sd); Cdraw(hdf22);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf23,sd); Cdraw(hdf23);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf47,sd); Cdraw(hdf47);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf48,sd); Cdraw(hdf48);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf49,sd); Cdraw(hdf49);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf50,sd); Cdraw(hdf50);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf51,sd); Cdraw(hdf51);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf52,sd); Cdraw(hdf52);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf53,sd); Cdraw(hdf53);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf54,sd); Cdraw(hdf54);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf55,sd); Cdraw(hdf55);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf56,sd); Cdraw(hdf56);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf57,sd); Cdraw(hdf57);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf58,sd); Cdraw(hdf58);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf59,sd); Cdraw(hdf59);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf60,sd); Cdraw(hdf60);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf61,sd); Cdraw(hdf61);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf62,sd); Cdraw(hdf62);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf63,sd); Cdraw(hdf63);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf64,sd); Cdraw(hdf64);
sd=hex(mb[r]);
sd=strright(sd,4);
r++;
Csetcontent(hdf65,sd); Cdraw(hdf65);
sd=hex(mb[r]);
sd=strright(sd,4);
Csetcontent(hdf66,sd); Cdraw(hdf66);
}
//Display Menu
on_hdf1(){
int state;
state=Cgetcursel(hdf2);
if(state==0){mf=1;}   //new data         
else if(state==1)mf=2;//filter
else if(state==2)mf=0;//quit
f=1;
}
on_hdf3(){
}
on_hdf4(){
}
on_hdf5(){
}
on_hdf6(){
}
on_hdf7(){
}
on_hdf8(){
}
on_hdf9(){
}
on_hdf10(){
}
on_hdf11(){
}
on_hdf12(){
}
on_hdf13(){
}
on_hdf14(){
}
//  ^ Key or UP hard button:
on_hdf15(){
int z,u;
string bux,fer;
if(up)v=si-2*0x48;
up=0;
down=1; 
searchBackward();
if(!showall)clearg();
dfdrawcontrols();
if(!findcount)
  {
  alert("Not Found");
  }
else
  {
  updateFullDisplay();
  if(si==0x28ffffb8)
    {
    alert("This Is The First Record");
    } 
  }
}
on_hdf16(){
}
on_hdf17(){
}
on_hdf18(){
}
on_hdf19(){
}
on_hdf20(){
}
on_hdf21(){
}
on_hdf22(){
}
on_hdf23(){
}
on_hdf47(){
}
on_hdf48(){
}
on_hdf49(){
}
on_hdf50(){
}
on_hdf51(){
}
on_hdf52(){
}
on_hdf53(){
}
on_hdf54(){
}
on_hdf55(){
}
on_hdf56(){
}
on_hdf57(){
}
on_hdf58(){
}
on_hdf59(){
}
on_hdf60(){
}
on_hdf61(){
}
on_hdf62(){
}
on_hdf63(){
}
on_hdf64(){
}
on_hdf65(){
}
on_hdf66(){
}
//   v Key or DOWN hard button:
on_hdf67(){
if(down)v=si+2*0x48;
up=1;
down=0;
searchForward();
if(!showall)clearg();
dfdrawcontrols();
if(!findcount)
  {
  alert("Not Found");
  }
else
  {
  updateFullDisplay();
  }
}
//Restore filter selections when coming back to the filter page
restorefilter()
{
int bz;
Csetstate(h7,showall);
Csetcursel(h6,rt);
Csetcursel(h3,tr);
for(bz=0;bz<sacount;bz++)
{
  if(sa[bz]==0){Csetstate(h9,1); continue;} 
  if(sa[bz]==1){Csetstate(h10,1); continue;}        
  if(sa[bz]==2){Csetstate(h11,1); continue;}
  if(sa[bz]==3){Csetstate(h12,1); continue;}
  if(sa[bz]==4){Csetstate(h13,1); continue;}
  if(sa[bz]==5){Csetstate(h14,1); continue;}
  if(sa[bz]==6){Csetstate(h15,1); continue;}
  if(sa[bz]==7){Csetstate(h16,1); continue;}
  if(sa[bz]==8){Csetstate(h17,1); continue;}
  if(sa[bz]==9){Csetstate(h18,1); continue;}
  if(sa[bz]==10){Csetstate(h19,1); continue;}
  if(sa[bz]==11){Csetstate(h20,1); continue;}
  if(sa[bz]==12){Csetstate(h21,1); continue;}
  if(sa[bz]==13){Csetstate(h22,1); continue;}
  if(sa[bz]==14){Csetstate(h23,1); continue;}
  if(sa[bz]==15){Csetstate(h24,1); continue;}
  if(sa[bz]==16){Csetstate(h25,1); continue;}
  if(sa[bz]==17){Csetstate(h26,1); continue;}
  if(sa[bz]==18){Csetstate(h27,1); continue;}
  if(sa[bz]==19){Csetstate(h28,1); continue;}
  if(sa[bz]==20){Csetstate(h29,1); continue;}
  if(sa[bz]==21){Csetstate(h30,1); continue;}
  if(sa[bz]==22){Csetstate(h31,1); continue;}
  if(sa[bz]==23){Csetstate(h32,1); continue;}
  if(sa[bz]==24){Csetstate(h33,1); continue;}
  if(sa[bz]==25){Csetstate(h34,1); continue;}
  if(sa[bz]==26){Csetstate(h35,1); continue;}
  if(sa[bz]==27){Csetstate(h36,1); continue;}
  if(sa[bz]==28){Csetstate(h37,1); continue;}
  if(sa[bz]==29){Csetstate(h38,1); continue;}
  if(sa[bz]==30){Csetstate(h39,1); continue;}
  if(sa[bz]==31){Csetstate(h40,1); continue;}
}

}
//Message loop for the Opening page
omessageloop(){ 
int e,b;
while(1){
e=event(1);
if(Cevent(ho1,e)) on_ho1();
else if(Cevent(ho4,e)) { on_ho4(); if(f){mf=2; break;}}
resetaot();//keep the  thing from turning off
}
//alert("You may now disconnect from the 1553 bus");
}
//Message loop for the Filter page
fmessageloop(){
int e,b;
while(1){
e=event(1);
b=bstate();  //use up/down (either) hard buttons to go to display page
hookhard(1); //disable hardkeys
if(Cevent(h1,e)) {on_h1();}
else if(Cevent(h3,e)) on_h3();
else if(Cevent(h4,e)) on_h4();
else if(Cevent(h5,e)) on_h5();
else if(Cevent(h6,e)) on_h6();
else if(Cevent(h7,e)) on_h7();
else if(Cevent(h8,e)) on_h8();
else if(Cevent(h9,e)) on_h9();
else if(Cevent(h10,e)) on_h10();
else if(Cevent(h11,e)) on_h11();
else if(Cevent(h12,e)) on_h12();
else if(Cevent(h13,e)) on_h13();
else if(Cevent(h14,e)) on_h14();
else if(Cevent(h15,e)) on_h15();
else if(Cevent(h16,e)) on_h16();
else if(Cevent(h17,e)) on_h17();
else if(Cevent(h18,e)) on_h18();
else if(Cevent(h19,e)) on_h19();
else if(Cevent(h20,e)) on_h20();
else if(Cevent(h21,e)) on_h21();
else if(Cevent(h22,e)) on_h22();
else if(Cevent(h23,e)) on_h23();
else if(Cevent(h24,e)) on_h24();
else if(Cevent(h25,e)) on_h25();
else if(Cevent(h26,e)) on_h26();
else if(Cevent(h27,e)) on_h27();
else if(Cevent(h28,e)) on_h28();
else if(Cevent(h29,e)) on_h29();
else if(Cevent(h30,e)) on_h30();
else if(Cevent(h31,e)) on_h31();
else if(Cevent(h32,e)) on_h32();
else if(Cevent(h33,e)) on_h33();
else if(Cevent(h34,e)) on_h34();
else if(Cevent(h35,e)) on_h35();
else if(Cevent(h36,e)) on_h36();
else if(Cevent(h37,e)) on_h37();
else if(Cevent(h38,e)) on_h38();
else if(Cevent(h39,e)) on_h39();
else if(Cevent(h40,e)) on_h40();
else if(Cevent(h41,e)||(b)) {on_h41(); if(f) break;}
resetaot();//keep the  thing from turning off
}
}

//Message loop for the Display page
dfmessageloop(){
int e,b;
while(1){
e=event(1);
b=bstate();  //use up/down hard buttons to scroll the display page
hookhard(1); //disable hardkeys
if(Cevent(hdf1,e)) {on_hdf1();if(f) break;}//User is leaving Display page
else if(Cevent(hdf15,e)||b==1) on_hdf15();//scroll "^" or UP hard button
else if(Cevent(hdf67,e)||b==-1) on_hdf67();//scroll "v" or DOWN hard button
resetaot();//keep the  thing from turning off
}
}
//Opening page 
omain(){
graph_on();
title("1553 Bus Analyzer");
oinitcontrols();
oinitcontents();
oinititems();
odrawcontrols();
//alert("Connect to 1553 bus, hit START when ready to gather data and hit STOP when finished gathering data.");
omessageloop();
}
//Filter page
fmain(){
clearg();
graph_on();
title("Filter");
finitcontrols();
finitcontents();
finititems();
restorefilter();//restore original filter selections
fdrawcontrols();
fmessageloop();
}
//Display page
dfmain(){
clearg();
graph_on();
title("Display");
dfinitcontrols();
dfinitcontents();
dfinititems();
dfdrawcontrols();
dfmessageloop();
}

mainmessageloop()
{
  mf=1;
  while(mf)
  {
  if(mf==1)     { omain(); f=0;} //Opening page
  else if(mf==2){ fmain(); f=0;} //Filter page
  else if(mf==3){ dfmain();f=0;} //Display page
  }
exit();
}

main()
{
  mainmessageloop();
}

⌨️ 快捷键说明

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