#include /* module mainscr9 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include union REGS inregs,outregs; /*--------------------------------------------------------------------------- meter signal names V1 MAGNET VOLTAGE 0 TTI module A7 V2 MAGNET VOLTAGE 1 BEAM VOLTAGE 2 V1 MAGNET CURRENT 3 V2 MAGNET CURRENT 4 BODY CURRENT 5 V1 FILAMENT VOLTAGE 6 V2 FILAMENT VOLTAGE 7 V1 FILAMENT CURRENT 8 V2 FILAMENT CURRENT 9 V1 COLLECTOR CURRENT 10 V2 COLLECTOR CURRENT 11 V1 VACION CURRENT 12 V2 VACION CURRENT 13 SPARE 14 SPARE 15 WASTER FWD POWER 16 TTI module A8 V1 FWD POWER 17 V1 RFL POWER 18 V2 FWD POWER 19 V2 RFL POWER 20 WASTER RFL POWER 21 TURNSTILE DL POWER 22 ANTENNA FWD POWER 23 ANTENNA RFL POWER 24 V1 RF DRIVE POWER 25 V2 RF DRIVE POWER 26 FLOW RATE 27 DELTA TEMP 28 SPARE 29 SPARE 30 SPARE 31 --------------------------------------------------------------------------- calculation names limit CALORIMETRIC POWER 0 32 KLYSTRON 1 VSWR 1 33 KLYSTRON 2 VSWR 2 34 WASTER VSWR 3 35 ANTENNA VSWR 4 36 TOTAL DRIVE POWER 5 37 SPARE 6 38 TOTAL BEAM CURRENT 7 39 TOTAL POWER DISSIPATION 8 40 AVG MAGNET VOLTAGE 9 41 AVG MAGNET CURRENT 10 42 AVG FILAMENT VOLTAGE 11 43 AVG FILAMENT CURRENT 12 44 */ /*****************************************************************************/ mainpanl(void) /* main (front panel) status screen */ { char *cmds[]= { "1","1","1","PM","AM","DRDN","DRUP","DROF","DRON","COFF","COOL", "RCV","XMT","LONG","SHRT","PBDN","PBUP","FLDN","FLUP","FLOF","FILS", "1","1","1","1","DBDN","DBUP","MDN","MUP","MOF","MAGS", "COMB","DL","TABL","BARS3","MISC","1","STBY", "ANT","WAST","BARS3","HVDN","HVUP","HVOF","HVON", "1","1", "AUTO","BARS","FAIL","FLOW","INTL","FALT","RSET","MUTE", 0 }; char *metcmds[]= { "BARS4", "BARS1", "BARS1", "BARS1","BARS1","BARS3","BARS3", "BARS3","BARS3","BARS3","BARS1", 0 }; int i,x1,y1; int x[]={ /* mouse target lower left */ 60,60,60,60,60,60,60,60,60,60,60, 160,160,160,160,160,160,160,160,160,160, 260,260,260,260,260,260,260,260,260,260, 360,360,360,360,360,360,360, 460,460,460,460,460,460,460, 560,560, 580,580,580,580,580,580,580,580 }; int y[]={ /* mouse target lower left */ 40,60,80,100,120,180,200,240,260,380,400, 40,60,80,100,180,200,320,340,380,400, 40,60,80,100,180,200,320,340,380,400, 40,60,120,200,320,380,400, 40,60,200,320,340,380,400, 40,60, 180,200,220,240,260,280,340,400 }; int xx[]={ /* metering target */ 60, 160, 260, 360,360,360,360, 460,460,460,460 }; int yy[]={ 260, 400, 400, 40,60,120,200, 40,60,200,400 }; screen=1; clkey(); if(screen!=oldscrn) refresh=1; oldscrn=screen; if(refresh) { clear(); /* clear entire screen */ oldayt[0]=0; /* reset date */ font(0); text(PALEBLUE,50,479,"723 S-BAND TRANSMITTER"); line2(WHITE,0,20,639,20); /* horz */ line(0,165,639,165); line(0,305,560,305); line(0,445,639,445); line(560,165,560,445); /* vert */ line(0,20,0,445); line(639,20,639,445); txnumber(); prompt("PageDown (left click), PageUp (right click) TO NEXT SCREEN"); text(PALEBLUE,60,440,"COOLING"); tex(50,360,"HV SETTING"); tex(150,440,"FILAMENTS"); tex(260,440,"MAGNETS"); tex(350,360,"FIL TIMER"); tex(440,440,"HIGH VOLTAGE"); tex(60,300,"RF DRIVE"); tex(155,240,"PHASE BAL"); tex(255,240,"DRIVE BAL"); tex(360,255,"WASTER"); tex(360,240,"POWER"); tex(455,255,"ANTENNA"); tex(460,240,"POWER"); tex(350,100,"WG SWITCH"); tex(165,140,"MODE"); tex(260,155,"CONTROL"); tex(260,140,"STATUS"); tex(60,160,"KEYING"); tex(340,160,"PRESET POWER"); tex(440,160,"DRIVE SETTING"); tex(450,100,"RF OUTPUT"); tex(560,115,"ON-LINE"); tex(560,100,"STATUS"); tex(580,440,"ALARM"); tex(580,380,"FAULT"); tex(575,320,"SUMMARY"); font(6); text(WHITE,5,40,"CONFIGURATION"); tex(5,180,"RF POWER ADJUST"); tex(5,320,"SYSTEM START-UP"); font(3); resetpb(0); /* reset push-button */ muted(status[27]&0x70); /* alarm muted */ box(DARKGREY,160,60,200,80,WHITE,"XMT"); box(DARKGREY,160,40,200,60,WHITE,"RCV"); } switch(click()) /* mouse button */ { case 1: /* left button */ { x1=outregs.x.cx; y1=479-outregs.x.dx; for(i=0;ix[i])&&(x1y[i])&&(y1x[i])&&(x1y[i])&&(y1xx[i])&&(x1yy[i])&&(y1=lolim[37]) color=GREEN; else color=YELLOW; ltoa(calc[5],numb,10); addec(2); /* decimal pt */ box(BLACK,63,263,97,277,color,numb); /* drive power */ } } if(refresh||counter[35]!=oldrvset||histno||logno) { itoa(rfwat(counter[35]),numb,10); addec(2); box(BLACK,460,120,500,140,YELLOW,numb); /* drive setting */ oldrvset=counter[35]; } up=status[17]&0x01; down=status[17]&0x02; olup=statup[17]&0x01; oldown=statup[17]&0x02; if(refresh||(up!=olup)||(down!=oldown)) { if(up) { box(DARKGREY,60,180,100,200,WHITE,"LOWER"); box(GREEN,60,200,100,220,WHITE,"RAISE"); } if(down) { box(GREEN,60,180,100,200,WHITE,"LOWER"); box(DARKGREY,60,200,100,220,WHITE,"RAISE"); } if(!(up)&&!(down)) /* (RS) */ { box(DARKGREY,60,180,100,200,WHITE,"LOWER"); box(DARKGREY,60,200,100,220,WHITE,"RAISE"); } } } /***************************************************************************/ cool(void) /* display cooling */ { unsigned char coolon,olcool,latch,olat; unsigned char tmph,oldtmph,warmwtr,olwarmwtr; /* (RS) */ coolon=((status[4]&0x30)==(0x30)); /* collector flow (RS)*/ olcool=((statup[4]&0x30)==(0x30)); /* collector flow (RS)*/ latch=status[17]&0x80; /* cool on pb (RS) */ olat=statup[17]&0x80; tmph=status[46]&0x40; /* cool over temp (RS) */ oldtmph=statup[46]&0x40; /* (RS) */ warmwtr=(status[2]&0xE0) /* cool temp warn (RS) */ ||(status[3]&0x0F); olwarmwtr=(statup[2]&0xE0) /* cool temp warn (RS) */ ||(statup[3]&0x0F); if(refresh||(coolon!=olcool)||(latch!=olat)||(tmph!=oldtmph) ||(warmwtr!=olwarmwtr)) { if((coolon)&&(!(tmph))&&(!(warmwtr))) /* (RS) */ { box(DARKGREY,60,380,100,400,WHITE,"OFF"); box(GREEN,60,400,100,420,WHITE,"ON"); } else if((coolon)&&(tmph)) /* (RS) */ { box(DARKGREY,60,380,100,400,WHITE,"OFF"); box(RED,60,400,100,420,BLACK,"HOT"); } else if((coolon)&&(!(tmph))&&(warmwtr)) /* (RS) */ { box(DARKGREY,60,380,100,400,WHITE,"OFF"); box(YELLOW,60,400,100,420,BLACK,"WARM"); } if(!coolon) /* cooling off (RS) */ { box(GREEN,60,380,100,400,WHITE,"OFF"); box(DARKGREY,60,400,100,420,WHITE,"ON"); } } } /***************************************************************************/ wgsw(void) /* display waveguide switches */ { unsigned char com1,olcom1,compb,dlpb,olcompb,oldlpb, com2,olcom2,dl1,oldl1,dl2,oldl2,comb,dl; com1=status[9]&0x04; /* v1 wg sw comb */ olcom1=statup[9]&0x04; /* v1 wg sw comb */ com2=status[8]&0x10; /* v2 wg sw comb */ olcom2=statup[8]&0x10; /* v2 wg sw comb */ dl1=status[9]&0x08; /* v1 wg sw dl (RS) */ oldl1=statup[9]&0x08; /* v1 wg sw dl (RS) */ dl2=status[9]&0x80; /* v2 wg sw dl (RS) */ oldl2=statup[9]&0x80; /* v2 wg sw dl (RS) */ dlpb=status[17]&0x08; /* dl pb */ oldlpb=statup[17]&0x08; /* dl pb */ compb=status[17]&0x04; /* combiner pb */ olcompb=statup[17]&0x04; /* combiner pb */ comb=com1&&com2; /* (RS) */ dl=dl1&&dl2; /* (RS) */ if(refresh ||(com1!=olcom1) ||(com2!=olcom2) ||(dl1!=oldl1) ||(dl2!=oldl2) ||(compb!=olcompb) ||(dlpb!=oldlpb)) { if(dl) /* on dummy load */ box(GREEN,360,60,400,80,WHITE,"KLY DL"); /* (RS) */ else box(DARKGREY,360,60,400,80,WHITE,"KLY DL"); /* (RS) */ if(comb) /* on combiner */ box(GREEN,360,40,400,60,WHITE,"COMB"); else box(DARKGREY,360,40,400,60,WHITE,"COMB"); if(dlpb) /* starting dummy load*/ box(YELLOW,360,60,400,80,BLACK,"KLY DL"); /* (RS) */ if(compb) /* starting combiner */ box(YELLOW,360,40,400,60,BLACK,"COMB"); } } /***************************************************************************/ rfsw(void) /* display rf switch state */ { unsigned char waster,olwaster; waster=status[14]&0x01; /* waster */ olwaster=statup[14]&0x01; /* old waster */ if(refresh||(waster!=olwaster)) { if(waster) { box(DARKGREY,460,40,500,60,WHITE,"ANT"); box(GREEN,460,60,500,80,WHITE,"WAST"); } else { box(GREEN,460,40,500,60,WHITE,"ANT"); box(DARKGREY,460,60,500,80,WHITE,"WAST"); } } } /***************************************************************************/ fila(void) /* display filaments */ { unsigned char filon,olfil,latch,olat,up,down,olup,oldown; int color; filon=status[20]&0x10; /* contactor */ olfil=statup[20]&0x10; /* contactor */ latch=status[14]&0x40; /* fil on pb (RS) */ olat=statup[14]&0x40; if(refresh||(filon!=olfil)||(latch!=olat)) { if(filon) /* filaments on (RS) */ { box(DARKGREY,160,380,200,400,WHITE,"OFF"); box(GREEN,160,400,200,420,WHITE,"ON"); } if(!filon) /* filaments off (RS) */ { box(GREEN,160,380,200,400,WHITE,"OFF"); box(DARKGREY,160,400,200,420,WHITE,"ON"); } } if(refresh||calc[11]!=olcalc[11]||histno||logno) { if(filon) { if(calc[11]<=hilim[43]&&calc[11]>=lolim[43]) color=GREEN; else color=YELLOW; ltoa(calc[11],numb,10); addec(1); /* decimal pt */ box(BLACK,163,403,197,417,color,numb); /* fil voltage */ } } up=status[15]&0x01; down=status[15]&0x02; olup=statup[15]&0x01; oldown=statup[15]&0x02; if(refresh||(up!=olup)||(down!=oldown)) { if(up) { box(DARKGREY,160,320,200,340,WHITE,"LOWER"); box(GREEN,160,340,200,360,WHITE,"RAISE"); } if (down) /* (RS) */ { box(GREEN,160,320,200,340,WHITE,"LOWER"); box(DARKGREY,160,340,200,360,WHITE,"RAISE"); } if (!up&&!down) /* (RS) */ { box(DARKGREY,160,320,200,340,WHITE,"LOWER"); box(DARKGREY,160,340,200,360,WHITE,"RAISE"); } } } /***************************************************************************/ magnet(void) /* display magnets */ { unsigned char mag1,mag2,latch1,latch2,mag,latch, up1,down1,olup1,oldown1,up2,down2,olup2,oldown2, up,down,olup,oldown; int color; mag1=status[20]&0x20; /* V1 mag ps contactor */ latch1=status[15]&0x40; /* V1 magnet on pb */ mag2=status[20]&0x40; /* V2 mag ps contactor */ latch2=status[16]&0x04; /* V2 magnet on pb */ if(mag1||mag2) /* (RS) */ mag=1; else mag=0; if(latch1||latch2) /* (RS) */ latch=1; else latch=0; if(refresh ||(mag1!=(statup[20]&0x20)) ||(latch1!=(statup[15]&0x40)) ||(mag2!=(statup[20]&0x40)) ||(latch2!=(statup[16]&0x04))) { if(mag) /* magnet on (RS) */ { box(DARKGREY,260,380,300,400,WHITE,"OFF"); box(GREEN,260,400,300,420,WHITE,"ON"); } if(!mag) /* off (RS) */ { box(GREEN,260,380,300,400,WHITE,"OFF"); box(DARKGREY,260,400,300,420,WHITE,"ON"); } } if(refresh||(calc[10]!=olcalc[10])||histno||logno) /* (RS) */ { if(mag1&&mag2) { if((calc[10]<=hilim[42])&&(calc[10]>=lolim[42])) color=GREEN; else color=YELLOW; ltoa(calc[10],numb,10); addec(1); /* decimal pt */ box(BLACK,263,403,297,417,color,numb); /* av mag current */ } if(mag1&&!mag2) /* (RS) */ { if((avmet[3]<=hilim[42])&&(avmet[3]>=lolim[42])) color=GREEN; else color=YELLOW; ltoa(avmet[3],numb,10); addec(1); /* decimal pt */ box(BLACK,263,403,297,417,color,numb); /* av mag current */ } if(mag2&&!mag1) /* (RS) */ { if((avmet[4]<=hilim[42])&&(avmet[4]>=lolim[42])) color=GREEN; else color=YELLOW; ltoa(avmet[4],numb,10); addec(1); /* decimal pt */ box(BLACK,263,403,297,417,color,numb); /* av mag current */ } } up1=status[16]&0x01; down1=status[16]&0x02; olup1=statup[16]&0x01; oldown1=statup[16]&0x02; up2=status[16]&0x10; down2=status[16]&0x20; olup2=statup[16]&0x10; oldown2=statup[16]&0x20; up=(up1)||(up2); /* (RS) */ down=(down1)||(down2); /* (RS) */ olup=(olup1)||(olup2); /* (RS) */ oldown=(oldown1)||(oldown2); /* (RS) */ if(refresh||(up!=olup)||(down!=oldown)) { if(up) { box(DARKGREY,260,320,300,340,WHITE,"LOWER"); box(GREEN,260,340,300,360,WHITE,"RAISE"); } if(down) { box(GREEN,260,320,300,340,WHITE,"LOWER"); box(DARKGREY,260,340,300,360,WHITE,"RAISE"); } if(!up&!down) { box(DARKGREY,260,320,300,340,WHITE,"LOWER"); box(DARKGREY,260,340,300,360,WHITE,"RAISE"); } } } /***************************************************************************/ hv(void) /* display high voltage */ { unsigned char hvon,olhv,latch,olat,up,down,olup,oldown; int color; hvon=status[19]&0x02; /* HV conactor (RS) */ olhv=statup[19]&0x02; latch=status[15]&0x04; /* HV on pb (RS) */ olat=statup[15]&0x04; if(refresh||(hvon!=olhv)||(latch!=olat)) { if(hvon) /* hv on (RS) */ { box(DARKGREY,460,380,500,400,WHITE,"OFF"); box(GREEN,460,400,500,420,WHITE,"ON"); } if(!hvon) /* hv off (RS) */ { box(GREEN,460,380,500,400,WHITE,"OFF"); box(DARKGREY,460,400,500,420,WHITE,"ON"); } } if(refresh||avmet[2]!=oldav[2]||histno||logno) { if(hvon) { if(avmet[2]<=hilim[2]&&avmet[2]>=lolim[2]) color=GREEN; else color=YELLOW; itoa(avmet[2],numb,10); addec(1); /* decimal pt */ box(BLACK,463,403,497,417,color,numb); /* beam voltage */ } } if(refresh||counter[43]!=olhvset||histno||logno) { box(BLACK,60,320,100,340,YELLOW,itoa(counter[43]/hvfac,numb,10)); olhvset=counter[43]; } up=status[15]&0x10; down=status[15]&0x20; olup=statup[15]&0x10; oldown=statup[15]&0x20; if(refresh||(up!=olup)||(down!=oldown)) { if(up) { box(DARKGREY,460,320,500,340,WHITE,"LOWER"); box(GREEN,460,340,500,360,WHITE,"RAISE"); } if(down) /* (RS) */ { box(GREEN,460,320,500,340,WHITE,"LOWER"); box(DARKGREY,460,340,500,360,WHITE,"RAISE"); } if(!up&!down) /* (RS) */ { box(DARKGREY,460,320,500,340,WHITE,"LOWER"); box(DARKGREY,460,340,500,360,WHITE,"RAISE"); } } } /***************************************************************************/ faltsum(i,mask) /* display overload sum */ { int level; level=status[i]&mask; if(refresh||(level!=(statup[i]&mask))) { if(level) /* overloads, recycle */ { box(RED,580,280,620,300,WHITE,"FALT"); phasor(2); if(counter[32]) screen=2; } else if(status[2]&0xFE /* (RS) */ ||status[3]&0xCF /* (RS) */ ||status[4]&0x01) /* (RS) */ { box(YELLOW,580,280,620,300,BLACK,"FALT"); phasor(2); if(counter[32]) screen=2; } else box(GREEN,580,280,620,300,WHITE,"FALT"); } } /****************************************************************************/ intsum(i,mask) /* display interlock summary */ { int level; level=status[i]&mask; if(refresh||(level!=(statup[i]&mask))) { if(level) box(GREEN,580,260,620,280,WHITE,"INTL"); else { box(YELLOW,580,260,620,280,BLACK,"INTL"); phasor(1); if(counter[32]) screen=3; } } } /****************************************************************************/ flowsum(i,mask) /* display cooling flow summary */ { int level,checkflow; level=status[i]&mask; checkflow=(status[4]&0xB0)||(status[5]) ||(status[6]&0x03); /* (RS) */ if(refresh||(level!=(statup[i]&mask))) { if(level) box(GREEN,580,240,620,260,WHITE,"FLOW"); else if((status[4]&0x30)==0x30) /* (RS) */ { box(RED,580,240,620,260,BLACK,"FLOW"); phasor(1); if(counter[32]) screen=3; } else if(checkflow) /* (RS) */ { box(YELLOW,580,240,620,260,BLACK,"FLOW"); phasor(1); if(counter[32]) screen=3; } else box(DARKGREY,580,240,620,260,WHITE,"FLOW"); } } /****************************************************************************/ failsum(i,mask) /* display failure summary */ { int level; level=status[i]&mask; if(refresh||(level!=(statup[i]&mask))) { if(level) { box(RED,580,220,620,240,WHITE,"FAIL"); phasor(2); if(counter[32]) screen=6; } else if((status[4]&0x06)||(status[7]&0xE0)) { box(YELLOW,580,220,620,240,BLACK,"FAIL"); phasor(2); if(counter[32]) screen=6; } else box(GREEN,580,220,620,240,WHITE,"FAIL"); } } /****************************************************************************/ boundsum(i,mask) /* display out-of-bounds summary */ { int level; level=status[i]&mask; if(refresh||(level!=(statup[i]&mask))) { if(level) { box(YELLOW,580,200,620,220,BLACK,"BARS"); phasor(1); if(counter[32]) screen=7; /* bar graph */ } else box(GREEN,580,200,620,220,WHITE,"BARS"); } } /****************************************************************************/ testsum(i,mask) /* display autotest failure summary */ { int level; level=status[i]&mask; if(refresh||(level!=(statup[i]&mask))) { if(level) { box(RED,580,180,620,200,WHITE,"AUTO"); phasor(2); if(counter[32]) screen=5; } else box(GREEN,580,180,620,200,WHITE,"AUTO"); } } /***************************************************************************/ resetpb(on) /* display reset push-button */ { if(on) box(YELLOW,580,340,620,360,BLACK,"RESET"); else box(DARKGREY,580,340,620,360,WHITE,"RESET"); } /***************************************************************************/ muted(on) /* display sonalert mute status */ { if(on) box(YELLOW,580,400,620,420,BLACK,"MUTE"); else box(DARKGREY,580,400,620,420,WHITE,"MUTE"); } /***************************************************************************/ mode(void) /* display xmt/rcv mode */ { int xmt,lon,rcv,olxmt,olon,olrcv; rcv=status[27]&0x01; olrcv=statup[27]&0x01; xmt=status[27]&0x02; olxmt=statup[27]&0x02; lon=status[27]&0x04; olon=statup[27]&0x04; if(refresh||(rcv!=olrcv)||(xmt!=olxmt)||(lon!=olon)) { if(rcv) { box(GREEN,160,40,200,60,WHITE,"RCV"); box(DARKGREY,160,60,200,80,WHITE,"XMT"); } if(xmt) { box(DARKGREY,160,40,200,60,WHITE,"RCV"); box(GREEN,160,60,200,80,WHITE,"XMT"); } if(lon) { box(GREEN,160,80,200,100,WHITE,"LONG"); box(DARKGREY,160,100,200,120,WHITE,"SHORT"); } if(!lon) { box(DARKGREY,160,80,200,100,WHITE,"LONG"); box(GREEN,160,100,200,120,WHITE,"SHORT"); } } } /***************************************************************************/ ready(void) /* display ready status */ { int rdy,olrdy; rdy=status[4]&0x40; olrdy=statup[4]&0x40; if(refresh||(rdy!=olrdy)) { if(rdy) box(GREEN,360,380,400,400,WHITE,"READY"); else box(DARKGREY,360,380,400,400,WHITE,"READY"); } } /***************************************************************************/ stby(void) /* display standby status */ { int sty,olsty; sty=status[9]&0x40; olsty=statup[9]&0x40; if(refresh||(sty!=olsty)) { if(sty) box(GREEN,360,400,400,420,BLACK,"STBY"); else box(DARKGREY,360,400,400,420,WHITE,"STBY"); } } /***************************************************************************/ remote(void) /* display local/remote mode */ { int color1,color2,odapc,ops,dome,hvps,olodapc,olops,oldome,olhvps; odapc=status[26]&0x08; /* odapc */ olodapc=statup[26]&0x08; ops=status[26]&0x10; /* ops local */ olops=statup[26]&0x10; dome=status[17]&0x20; /* dome remote */ oldome=statup[17]&0x20; hvps=status[22]&0x10; /* hvps remote */ olhvps=statup[22]&0x10; if(status[45]&0x40) /* illegal control mode */ { color1=RED; color2=RED; } else { color1=YELLOW; color2=GREEN; } if(refresh ||(dome!=oldome)||(ops!=olops)||(odapc!=olodapc)||(hvps!=olhvps)) { if(!hvps) /* hvps control */ box(color1,260,100,300,120,BLACK,"HVPS"); else box(DARKGREY,260,100,300,120,WHITE,"HVPS"); if(!dome) /* dome control */ box(color1,260,80,300,100,BLACK,"DOME"); else box(DARKGREY,260,80,300,100,WHITE,"DOME"); if(ops) /* local control*/ box(color1,260,60,300,80,BLACK,"OPS"); else box(DARKGREY,260,60,300,80,WHITE,"OPS"); if(odapc) /* observatory control*/ box(color2,260,40,300,60,WHITE,"ODAPC"); else box(DARKGREY,260,40,300,60,WHITE,"ODAPC"); } } /***************************************************************************/ keying(void) /* display local/external keying mode */ { int cw,ext,am,pm,odapc,olpc,off,xam,xpm,olcw,olext,olam,olpm,oloff,olxam,olxpm; ext=status[23]&0x80; olext=statup[23]&0x80; am=status[23]&0x20; olam=statup[23]&0x20; pm=status[23]&0x10; olpm=statup[23]&0x10; off=status[23]&0x40; olpc=statup[26]&0x08; odapc=status[26]&0x08; oloff=statup[23]&0x40; cw=status[26]&0x20; olcw=statup[26]&0x20; xam=status[26]&0x80; olxam=statup[26]&0x80; xpm=status[26]&0x40; olxpm=statup[26]&0x40; if(refresh ||(am!=olam)||(pm!=olpm)||(off!=oloff) ||(ext!=olext)||(cw!=olcw)||(olpc!=odapc) ||(xpm!=olxpm)||(xam!=olxam)) { if(ext) /* remote control */ box(GREEN,60,40,100,60,WHITE,"EXT"); else box(DARKGREY,60,40,100,60,WHITE,"EXT"); if(off) /* keying off */ box(GREEN,60,60,100,80,WHITE,"OFF"); else box(DARKGREY,60,60,100,80,WHITE,"OFF"); if(cw) /* local cw test */ box(YELLOW,60,80,100,100,BLACK,"CW"); else box(DARKGREY,60,80,100,100,WHITE,"CW"); if(pm&&!odapc) /* local pm test */ box(YELLOW,60,100,100,120,BLACK,"PM"); else if(xpm&&(ext||odapc)) /* external pm */ box(GREEN,60,100,100,120,WHITE,"PM"); else box(DARKGREY,60,100,100,120,WHITE,"PM"); if(am&&!odapc) /* local am test */ box(YELLOW,60,120,100,140,BLACK,"AM"); else if(xam&&(ext||odapc)) /* external am */ box(GREEN,60,120,100,140,WHITE,"AM"); else box(DARKGREY,60,120,100,140,WHITE,"AM"); } } /***************************************************************************/ phasbal(void) /* phase balance push-buttons */ { int up,down,olup,oldown; up=status[24]&0x01; down=status[24]&0x02; olup=statup[24]&0x01; oldown=statup[24]&0x02; if(refresh||(up!=olup)||(down!=oldown)) { if(up) { box(DARKGREY,160,180,200,200,WHITE,"LOWER"); box(GREEN,160,200,200,220,WHITE,"RAISE"); } if(down) /* (RS) */ { box(GREEN,160,180,200,200,WHITE,"LOWER"); box(DARKGREY,160,200,200,220,WHITE,"RAISE"); } if(!up&!down) /* (RS) */ { box(DARKGREY,160,180,200,200,WHITE,"LOWER"); box(DARKGREY,160,200,200,220,WHITE,"RAISE"); } } } /***************************************************************************/ drivbal(void) /* drive balance push-buttons */ { unsigned char up,down,olup,oldown; up=status[24]&0x04; down=status[24]&0x08; olup=statup[24]&0x04; oldown=statup[24]&0x08; if(refresh||(up!=olup)||(down!=oldown)) { if(up) { box(DARKGREY,260,180,300,200,WHITE,"LOWER"); box(GREEN,260,200,300,220,WHITE,"RAISE"); } if(down) /* (RS) */ { box(GREEN,260,180,300,200,WHITE,"LOWER"); box(DARKGREY,260,200,300,220,WHITE,"RAISE"); } if(!up&!down) /* (RS) */ { box(DARKGREY,260,180,300,200,WHITE,"LOWER"); box(DARKGREY,260,200,300,220,WHITE,"RAISE"); } } } /***************************************************************************/ powers(void) /* display RF powers, timers */ { int color,filtime,filsec,filmin; /* (RS) */ int cooltime,coolsec,coolmin; /* (RS) */ char string[6]; /* (RS) */ if(refresh||avmet[16]!=oldav[16]||histno||logno) /* waster power */ { if(avmet[16]<=hilim[16]&&avmet[16]>=lolim[16]) color=GREEN; else color=YELLOW; itoa(avmet[16],numb,10); box(BLACK,360,200,400,220,color,numb); } if(refresh||avmet[23]!=oldav[23]||histno||logno) /* antenna power */ { if(avmet[23]<=hilim[23]&&avmet[23]>=lolim[23]) color=GREEN; else color=YELLOW; itoa(avmet[23],numb,10); box(BLACK,460,200,500,220,color,numb); } if(refresh||counter[47]!=old47) /* (RS) */ { itoa(prepow[counter[47]-1],numb,10); /* preset power level */ box(BLACK,360,120,400,140,GREEN,numb); old47=counter[47]; /* (RS) */ } if(refresh) { filtime=(int)((double)counter[40]/18.2); /* (RS) */ filsec=filtime%60; /* (RS) */ filmin=filtime/60; /* (RS) */ itoa(filmin,numb,10); /* (RS) */ if(filmin<10) /* (RS) */ { strcpy(string,"0"); strcat(string,numb); } else strcpy(string,numb); /* (RS) */ strcat(string,":"); /* (RS) */ itoa(filsec,numb,10); /* (RS) */ if(filsec<10) /* (RS) */ strcat(string,"0"); strcat(string,numb); /* (RS) */ box(BLACK,360,320,400,340,YELLOW,string); /* filament time (RS) */ } if(refresh&&counter[52]) /* cool down timer (RS) */ { cooltime=(int)((double)counter[52]/18.2); /* (RS) */ coolsec=cooltime%60; /* (RS) */ coolmin=cooltime/60; /* (RS) */ itoa(coolmin,numb,10); /* (RS) */ if(coolmin<10) /* (RS) */ { strcpy(string,"0"); strcat(string,numb); } else strcpy(string,numb); /* (RS) */ strcat(string,":"); /* (RS) */ itoa(coolsec,numb,10); /* (RS) */ if(coolsec<10) /* (RS) */ strcat(string,"0"); strcat(string,numb); /* (RS) */ box(BLACK,60,380,100,400,YELLOW,numb); } } /*****************************************************************************/ online(void) /* active klystrons */ { unsigned char k1,k2,olk1,olk2; k1=status[8]&0x01; k2=status[8]&0x02; olk1=statup[8]&0x01; olk2=statup[8]&0x02; if(refresh||(k1!=olk1)||(k2!=olk2)) { if(k1) box(GREEN,560,60,600,80,WHITE,"KLY 1"); else box(DARKGREY,560,60,600,80,WHITE,"KLY 1"); if(k2) box(GREEN,560,40,600,60,WHITE,"KLY 2"); else box(DARKGREY,560,40,600,60,WHITE,"KLY 2"); } }