#include /* module faults9 */ #include #include #include #include #include #include #include #include #include #include #include #include #include /* mods: pjp004 auxrf->floor,lownoiseamp-> shutter */ /*****************************************************************************/ faults(void) /* fault screen */ { char *list0[]= { "HE A1 FANS", "HE A2 FANS", "HE A3 FANS", "WATER LEVEL", "WATER PURITY", "DI NITROGEN", "WG NITROGEN", "HVPS OIL", "MAIN PUMP", "WG PUMP", 0 }; char *list1[]= { "TRANSMITTER OUT WG", "TX ROOM SPARES", "FEEDROOM SPARES", "FEEDROOM WG", 0 }; char *list2[]= { "FILAMENT I", "FILAMENT V", "MAGNET I", "MAGNET V", "COLLECTOR I", "VACION I", "WG ARC", "REFL PWR", 0 }; char *list7[]= { "TURNSTILE PWR", "WASTER REFL PWR", "ANTENNA REFL PWR", "BODY I", "BEAM V", "HVPS BREAKER", "HVPS CONTACTOR", "HVPS DC I", "HVPS AC I", "480 VAC", "HVPS MOV", "EMERG OFF INTRLC", 0 }; char *list3[]= { "WG SWITCH", "VACION V", "FILAMENT I", "FILAMENT V", "MAGNET I", "MAGNET V", 0 }; char *list5[]={ "AMPLIFIER DOOR", "GND STICK", "GND SWITCH", "HVPS DOOR", "HVPS GND STICK", "HVPS GND SWITCH", "HVPS BREAKER", "SHUTTER", /* */ "FLOOR", /* */ "CROWBAR HEAT", "CROWBAR BLOWER", "CROWBAR READY", /* (RS) */ "EXCITER INPUT", 0 }; char *list4[]= { "______ BODY ______", "_____ MAGNET _____", "___ COLLECTOR ___", " WAVEGUIDE ___", "_____ SOCKET _____", 0 }; char *list6[]= { "OK", "WARNING", "FAULT", 0 }; char *list8[]= { "TRIGGERED", "FIRED", 0 }; char *list9[]= { "FIRST FAULT", "PROOF MISSING", "INTLK MISSING", 0 }; screen=2; clkey(); if(screen!=oldscrn) refresh=1; if(refresh) { clear(); /* clear screen */ oldayt[0]=0; font(1); text(WHITE,70,479,"COOLING"); tex(10,460,"TEMP"); tex(150,460,"FLOW"); tex(310,460,"FAULTS"); tex(470,440,"INTERLOCKS"); tex(170,200,"CROWBAR"); tex(70,100,"LEGEND"); font(2); tex(10,440,"KLY1 KLY2"); tex(150,440,"KLY1 KLY2"); tex(310,440,"KLY1 KLY2"); tex(470,420,"KLY1 KLY2"); txnumber(); square(GREY,170,20); /* legend */ square(GREY,170,40); square(VIOLET,170,60); square(RED,30,20); square(YELLOW,30,40); square(GREEN,30,60); text(BLACK,177,35,"I"); /* interlock */ text(BLACK,177,55,"P"); /* proof */ text(BLACK,174,75,"FF"); /* first fault */ tex(37,35,"F"); /* fault */ tex(35,55,"W"); /* warning */ texcolor(PALEBLUE); list(60,75,20,list6); /* legend */ list(200,75,20,list9); /* legend */ list(200,175,20,list8); /* crowbar */ list(60,415,20,list4); /* overtemp/flow */ list(60,295,20,list0); /* misc cooling */ list(200,295,20,list1); /* single flow */ list(370,415,20,list2); /* dual overload */ list(360,255,20,list7); /* single overload */ list(530,395,20,list3); /* dual interlock */ list(520,275,20,list5); /* single interlock */ tex(200,115,"RF LOCK-OUT"); } fbox(20,400,13,0x02); /* v1 body temp (RS) */ fbox(20,380,13,0x08); /* v1 magnet temp (RS) */ fbox(20,360,13,0x20); /* v1 collector temp (RS) */ fbox(40,400,13,0x04); /* v2 body temp (RS) */ fbox(40,380,13,0x10); /* v2 magnet temp (RS) */ fbox(40,360,13,0x40); /* v2 collector temp (RS) */ fbox(30,320,14,0x02); /* socket temp (RS) */ if(!(status[13]&0x02)) /* no fault? (RS) */ wbox(20,400,2,0x40); /* v1 body temp warn (RS) */ if(!(status[13]&0x08)) /* no fault? (RS) */ wbox(20,380,3,0x01); /* v1 magnet temp warn (RS) */ if(!(status[13]&0x20)) /* no fault? (RS) */ wbox(20,360,3,0x04); /* v1 collector temp warn (RS) */ if(!(status[13]&0x04)) /* no fault? (RS) */ wbox(40,400,2,0x80); /* v2 body temp warn (RS) */ if(!(status[13]&0x10)) /* no fault? (RS) */ wbox(40,380,3,0x02); /* v2 magnet temp warn (RS) */ if(!(status[13]&0x40)) /* no fault? (RS) */ wbox(40,360,3,0x08); /* v2 collector temp warn (RS) */ if(!(status[14]&0x02)) /*(RS) */ wbox(30,320,2,0x20); /* socket temp warn (RS) */ wbox(30,280,2,0x02); /* fans 1 fault */ wbox(30,260,2,0x04); /* fans 2 fault */ wbox(30,240,2,0x08); /* fans 3 fault */ pbox(30,220,4,0x08); /* water level proof (RS) */ if(status[4]&0x08) /* water level proof (RS) */ wbox(30,220,2,0x10); /* water level warn */ wbox(30,200,3,0x80); /* water purity warn */ wbox(30,180,3,0x40); /* nitrogen pressure warn */ wbox(30,160,4,0x01); /* wg nitrogen pressure (RS) */ fbox(30,140,19,0x20); /* hvps oil fault */ fbox(30,120,18,0x40); /* main pump fault */ fbox(30,100,18,0x80); /* wg pump fault */ fbox(170,100,29,0x40); /* RF lock out (RS) */ pbox(160,400,5,0x10); /* v1 body flow (RS) */ pbox(160,380,5,0x40); /* v1 magnet flow (RS) */ pbox(160,360,4,0x10); /* v1 collector flow (RS) */ pbox(160,340,6,0x01); /* v1 wg flow (RS) */ pbox(180,400,5,0x20); /* v2 body flow (RS) */ pbox(180,380,5,0x80); /* v2 magnet flow (RS) */ pbox(180,360,4,0x20); /* v2 collector flow (RS) */ pbox(180,340,6,0x02); /* v2 wg flow (RS) */ pbox(170,320,5,0x08); /* socket flow (RS) */ pbox(170,280,4,0x80); /* transmitter out wg flow (RS) */ pbox(170,260,5,0x02); /* transmitter room spares flow (RS) */ pbox(170,240,5,0x01); /* feedroom spares flow (RS) */ pbox(170,220,5,0x04); /* feedroom flow (RS) */ fbox(170,160,21,0x04); /* crowbar triggered */ fbox(170,140,21,0x02); /* crowbar fired */ fbox(320,400,10,0x01); /* v1 filament current ovld */ fbox(320,380,10,0x04); /* v1 filament voltage ovld */ fbox(320,360,11,0x01); /* v1 magnet current ovld */ ffbox(320,360,0,0x08); /* v1 magnet current ff */ fbox(320,340,11,0x04); /* v1 magnet voltage ovld */ ffbox(320,340,0,0x20); /* v1 magnet voltage ff */ fbox(320,320,11,0x10); /* v1 collector current ovld */ ffbox(320,320,0,0x02); /* v1 collector current ff */ fbox(320,300,11,0x40); /* v1 vacion current ovld */ ffbox(320,300,0,0x80); /* v1 vacion current ff */ fbox2(320,280,12,0x20,18,0x10); /* v1 wg arc */ ffbox(320,280,1,0x04); /* v1 wg arc ff */ fbox2(320,260,12,0x80,10,0x40); /* v1 reflected power */ ffbox(320,260,1,0x10); /* v1 reflected power ff */ fbox(340,400,10,0x02); /* v2 filament current ovld */ fbox(340,380,10,0x08); /* v2 filament voltage ovld */ fbox(340,360,11,0x02); /* v2 magnet current ovld */ ffbox(340,360,0,0x10); /* v2 magnet current ff */ fbox(340,340,11,0x08); /* v2 magnet voltage ovld */ ffbox(340,340,0,0x40); /* v2 magnet voltage ff */ fbox(340,320,11,0x20); /* v2 collector current ovld */ ffbox(340,320,0,0x04); /* v2 collector current ff */ fbox(340,300,11,0x80); /* v2 vacion current ovld */ ffbox(340,300,1,0x01); /* v2 vacion current ff */ fbox2(340,280,12,0x40,18,0x20); /* v2 wg arc */ ffbox(340,280,1,0x08); /* v2 wg arc ff */ fbox2(340,260,13,0x01,10,0x80); /* v2 reflected power */ ffbox(340,260,1,0x20); /* v2 reflected power ff */ fbox2(330,240,12,0x04,18,0x04); /* dl power ovld */ ffbox(330,240,2,0x01); /* dl power ff */ fbox2(330,220,12,0x08,10,0x10); /* combiner reflected power */ ffbox(330,220,1,0x40); /* combiner reflected power ff */ fbox2(330,200,12,0x10,10,0x20); /* antenna reflected power */ ffbox(330,200,1,0x80); /* antenna reflected power ff */ fbox2(330,180,12,0x01,18,0x08); /* body current ovld */ ffbox(330,180,0,0x01); /* body current ff (RS) */ fbox(330,160,12,0x02); /* beam voltage ovld */ fbox(330,140,20,0x01); /* hvps breaker fault */ fbox(330,120,21,0x20); /* hvps contactor fault */ fbox(330,100,20,0x80); /* hvps dc current ovld */ fbox(330,80,21,0x01); /* hvps ac current ovld */ fbox(330,60,21,0x08); /* hvps phase fault */ fbox(330,40,21,0x10); /* hvps mov fault */ ibox(330,20,22,0x04); /* emerg off intrloc (RS) */ pbox2(480,380,9,0x04,9,0x08); /* v1 wg switch interlock */ pbox(480,360,6,0x04); /* v1 vacion voltage intlk */ pbox(480,340,6,0x10); /* v1 filament current intlk */ pbox(480,320,6,0x40); /* v1 filament voltage intlk */ pbox(480,300,7,0x01); /* v1 magnet current intlk */ pbox(480,280,7,0x04); /* v1 magnet voltage intlk */ pbox2(500,380,9,0x80,8,0x10); /* v2 wg switch interlock */ pbox(500,360,6,0x08); /* v2 vacion voltage intlk */ pbox(500,340,6,0x20); /* v2 filament current intlk */ pbox(500,320,6,0x80); /* v2 filament voltage intlk */ pbox(500,300,7,0x02); /* v2 magnet current intlk */ pbox(500,280,7,0x08); /* v2 magnet voltage intlk */ ibox(490,260,8,0x04); /* dome amplifier door intlk */ ibox(490,240,8,0x40); /* dome ground stick */ ibox(490,220,8,0x80); /* dome ground switch */ ibox(490,200,19,0x04); /* hvps door intlk */ ibox(490,180,19,0x10); /* hvps ground stick */ ibox(490,160,19,0x80); /* hvps ground switch (RS) */ ibox(490,140,19,0x01); /* hvps breaker */ ibox(490,120,9,0x01); /* SHUTTER intlk */ ibox(490,100,9,0x02); /* FLOOR intlk */ pbox(490,80,20,0x02); /* crowbar heat (RS) */ pbox(490,60,20,0x04); /* crowbar blower (RS) */ ibox(490,40,46,0x01); /* crowbar ready (RS) */ ibox(490,20,38,0x40); /* exciter rf input */ refresh=0; oldscrn=screen; } /***************************************************************************/ failures(void) /* misc failure screen */ { char *list1[]= { "24V OPERATIONS POWER", "COMMAND DID NOT EXECUTE ", "COM1 ERROR", "COM2 ERROR", "COM3 ERROR", "LOGS ALMOST FULL", "LOGS FULL", "XOFF TIME-OUT", "HVPS KEEP-ALIVE", "DOME KEEP-ALIVE", "ILLEGAL KEY POSITION", "TEST FAIL OVER-RIDE", "HOT CROWBAR TEST DECLINED", "HACKER", "HVPS RESET OVER-RIDE", "TRACKBALL", "DOS ERROR", "PRINTER OUT OF PAPER", 0 }; char *list2[]= { "TTI 1, DOME STATUS", "TTI 2, DOME STATUS", "TTI 3, DOME STATUS", "TTI 4, DOME STATUS", "TTI 5, DOME STATUS", "TTI 6, DOME DAC", "TTI 7, DOME METERING", "TTI 8, DOME METERING", "TTI 9, DOME CONTROL", "TTI 10, DOME CONTROL", "TTI 11, HVPS DAC", "TTI 12, HVPS STATUS", "TTI 13, HVPS CONTROL", "TTI INIT", "KLY1 REFL DETECTOR", "KLY2 REFL DETECTOR", "ANTENNA REFL DETECTOR", "WASTER REFL DETECTOR", "TURNSTILE LOAD FWD DETECTOR", 0 }; screen=6; clkey(); if(screen!=oldscrn) refresh=1; if(refresh) { clear(); /* clear screen */ oldayt[0]=0; font(0); text(PALEBLUE,40,479,"FAILURES & WARNINGS"); txnumber(); texcolor(PALEBLUE); list(30,415,20,list1); list(330,415,20,list2); } pbox(0,400,23,0x01); /* 24V PS prove (RS) */ fbox(0,380,36,0x02); /* command fail */ fbox(0,360,35,0x01); /* COM1 fail */ fbox(0,340,35,0x02); /* COM2 fail */ fbox(0,320,35,0x04); /* COM3 fail */ fbox(0,300,38,0x10); /* logs almost full */ fbox(0,280,36,0x01); /* logs full */ fbox(0,260,27,0x08); /* xoff time-out */ fbox(0,240,19,0x08); /* hvps keep-alive */ fbox(0,220,8,0x20); /* dome keep-alive */ fbox(0,200,45,0x40); /* illegal key posn */ fbox(0,180,38,0x80); /* test failure over-ride */ fbox(0,160,45,0x80); /* declined hot cb test */ fbox(0,140,46,0x02); /* hacker */ fbox(0,120,46,0x04); /* hvps reset over-ride */ fbox(0,100,46,0x10); /* trackball not found */ fbox(0,80,46,0x20); /* DOS error */ fbox(0,60,46,0x80); /* out of paper */ fbox(300,400,28,0x01); /* TTI 1 fail */ fbox(300,380,28,0x02); /* TTI 2 fail */ fbox(300,360,28,0x04); /* TTI 3 fail */ fbox(300,340,28,0x08); /* TTI 4 fail */ fbox(300,320,28,0x10); /* TTI 5 fail */ fbox(300,300,28,0x20); /* TTI 6 fail */ fbox(300,280,28,0x40); /* TTI 7 fail */ fbox(300,260,28,0x80); /* TTI 8 fail */ fbox(300,240,29,0x01); /* TTI 9 fail */ fbox(300,220,29,0x02); /* TTI 10 fail */ fbox(300,200,29,0x04); /* TTI 11 fail */ fbox(300,180,29,0x08); /* TTI 12 fail */ fbox(300,160,29,0x10); /* TTI 13 fail */ fbox(300,140,46,0x08); /* TTI init fail */ wbox(300,120,7,0x40); /* kly1 refl det fail */ wbox(300,100,7,0x80); /* kly2 refl det fail */ wbox(300,80,4,0x04); /* ant refl det fail */ wbox(300,60,4,0x02); /* waster refl det fail */ wbox(300,40,7,0x20); /* turnstile det fail */ refresh=0; oldscrn=screen; } /**************************************************************************/ ffbox(x,y,i,mask) /* draw first-fault lamp */ { int level; level=status[i]&mask; if(refresh||level!=(statup[i]&mask)) if(level) { square(VIOLET,x,y); text(BLACK,x+4,y+15,"FF"); /* first fault */ } } /**************************************************************************/ fbox(x,y,i,mask) /* draw fault lamp */ { int color,level; level=status[i]&mask; if(refresh||level!=(statup[i]&mask)) { if(level) color=RED; else color=GREEN; square(color,x,y); if(level) text(BLACK,x+7,y+15,"F"); /* fault */ } } /**************************************************************************/ fbox2(x,y,i1,mask1,i2,mask2) /* draw fault lamp */ { int color,lev,olev; lev=(status[i1]&mask1)||(status[i2]&mask2); olev=(statup[i1]&mask1)||(statup[i2]&mask2); if(refresh||(lev!=olev)) { if(lev) color=RED; else color=GREEN; square(color,x,y); if(lev) text(BLACK,x+7,y+15,"F"); /* fault */ } } /***************************************************************************/ pbox(x,y,i,mask) /* draw proof lamp */ { int color,level; level=status[i]&mask; if(refresh||level!=(statup[i]&mask)) { if(level) color=GREEN; /* on */ else color=GREY; /* off */ square(color,x,y); if(!level) text(BLACK,x+5,y+15,"P"); /* not proved */ } } /**************************************************************************/ pbox2(x,y,i1,mask1,i2,mask2) /* draw proof lamp (RS) */ { int color,lev,olev; lev=(status[i1]&mask1)||(status[i2]&mask2); olev=(statup[i1]&mask1)||(statup[i2]&mask2); if(refresh||(lev!=olev)) { if(lev) color=GREEN; /* on */ else color=GREY; /* off */ square(color,x,y); if(!lev) text(BLACK,x+5,y+15,"P"); /* not proved */ } } /****************************************************************************/ ibox(x,y,i,mask) /* draw interlock lamp */ { int color,level; level=status[i]&mask; if(refresh||level!=(statup[i]&mask)) { if(level) color=GREEN; /* closed */ else color=GREY; /* open */ square(color,x,y); if(!level) text(BLACK,x+5,y+15,"I"); /* interlock open */ } } /****************************************************************************/ wbox(x,y,i,mask) /* draw warning lamp */ { int color,level; level=status[i]&mask; if(refresh||level!=(statup[i]&mask)) { if(level) color=YELLOW; /* asserted */ else color=GREEN; /* ok */ square(color,x,y); if(level) text(BLACK,x+5,y+15,"W"); /* warning */ } }