#include /* module parsepb */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /**************************************************************************/ parsepb(void) /* execute push-button commands */ { if(status[26]&0x04) /* ops hv off */ { status[26]&=0xFB; highvolt(0); } if(status[15]&0x08) /* dome hv off */ { status[15]&=0xF7; highvolt(0); } if(status[22]&0x80) /* hvps hv off */ { status[22]&=0x7F; highvolt(0); } if(status[26]&0x01) /* ops alarm mute */ { status[26]&=0xFE; mute(1); } if(status[17]&0x40) /* dome alarm mute */ { status[17]&=0xBF; mute(2); } if(status[21]&0x40) /* hvps alarm mute */ { status[21]&=0xBF; mute(3); } if((status[26]&0x10) /* ops in local mode */ &&(status[17]&0x20) /* dome in remote mode */ &&(status[22]&0x10)) /* hvps in remote mode */ { if(status[23]&0x04) /* ops reset */ { status[23]&=0xFB; reset(); } if(status[26]&0x02) /* ops hv on */ { status[26]&=0xFD; highvolt(1); } } else if((status[23]&0x04) /* ops pbs */ ||(status[26]&0x07)) warn("OPS NOT IN LOCAL MODE"); if(!(status[17]&0x20) /* dome in local mode */ &&(status[23]&0x02) /* ops in remote mode */ &&(status[22]&0x10)) /* hvps in remote mode */ { if(status[17]&0x10) /* dome reset */ { status[17]&=0xEF; reset(); } if(status[17]&0x80) /* dome cooling on */ { status[17]&=0x7F; cooling(1); } if(status[18]&0x01) /* dome cooling off */ { status[18]&=0xFE; cooling(0); } if(status[14]&0x40) /* dome filament on */ { status[14]&=0xBF; filament(1); } if(status[14]&0x80) /* dome filament off */ { status[14]&=0x7F; filament(0); } if(status[15]&0x01) /* dome filament raise */ { status[15]&=0xFE; filament(3); } if(status[15]&0x02) /* dome filament lower */ { status[15]&=0xFD; filament(2); } if(status[16]&0x40) /* dome drive on */ { status[16]&=0xBF; driver(1); } if(status[16]&0x80) /* dome drive off */ { status[16]&=0x7F; driver(0); } if(status[17]&0x01) /* dome drive raise */ { status[17]&=0xFE; driver(3); } if(status[17]&0x02) /* dome drive lower */ { status[17]&=0xFD; driver(2); } if(status[14]&0x04) /* dome driver phase raise */ { status[14]&=0xFB; phasebal(1); } if(status[14]&0x08) /* dome driver phase lower */ { status[14]&=0xF7; phasebal(0); } if(status[14]&0x10) /* dome driver balance raise */ { status[14]&=0xEF; drivebal(1); } if(status[14]&0x20) /* dome driver balance lower */ { status[14]&=0xDF; drivebal(0); } if(status[15]&0x40) /* dome magnet1 on */ { status[15]&=0xBF; magnet1(1); } if(status[15]&0x80) /* dome magnet1 off */ { status[15]&=0x7F; magnet1(0); } if(status[16]&0x01) /* dome magnet1 raise */ { status[16]&=0xFE; magnet1(3); } if(status[16]&0x02) /* dome magnet1 lower */ { status[16]&=0xFD; magnet1(2); } if(status[16]&0x04) /* dome magnet2 on */ { status[16]&=0xFB; magnet2(1); } if(status[16]&0x08) /* dome magnet2 off */ { status[16]&=0xF7; magnet2(0); } if(status[16]&0x10) /* dome magnet2 raise */ { status[16]&=0xEF; magnet2(3); } if(status[16]&0x20) /* dome magnet2 lower */ { status[16]&=0xDF; magnet2(2); } if(status[15]&0x04) /* dome hv on */ { status[15]&=0xFB; highvolt(1); } if(status[15]&0x10) /* dome hv raise */ { status[15]&=0xEF; highvolt(3); } if(status[15]&0x20) /* dome hv lower */ { status[15]&=0xDF; highvolt(2); } if(status[18]&0x02) /* dome standby */ { status[18]&=0xFD; standby(); } if(status[17]&0x04) /* dome combiner */ { status[17]&=0xFB; wgswitch(0); } if(status[17]&0x08) /* dome dummy load */ { status[17]&=0xF7; wgswitch(1); } } else if((status[14]&0xFC) /* dome pbs */ ||(status[15]&0xF7) ||(status[16]&0xFF) ||(status[17]&0xDF) ||(status[18]&0x03)) warn("DOME NOT IN LOCAL MODE"); if(!(status[22]&0x10) /* hvps in local mode */ &&(status[23]&0x02) /* ops in remote mode */ &&(status[17]&0x20)) /* dome in remote mode */ { if(status[19]&0x40) /* hvps reset */ { status[19]&=0xBF; reset(); } if(status[22]&0x08) /* hvps hv on */ { status[22]&=0xF7; highvolt(1); } if(status[22]&0x20) /* hvps hv raise */ { status[22]&=0xDF; highvolt(3); } if(status[22]&0x40) /* hvps hv lower */ { status[22]&=0xBF; highvolt(2); } } else if((status[19]&0x40) /* hvps pbs */ ||(status[21]&0x40) ||(status[22]&0xE8)) warn("HVPS NOT IN LOCAL MODE"); } /***************************************************************************/ funky(k) /* parse function keys */ { int fail=0; clrkey(); switch(k) { case F1: strcpy(keyboard,func); break; case F2: strcpy(keyboard,&func[0]+20); break; case F3: strcpy(keyboard,&func[0]+40); break; case F4: strcpy(keyboard,&func[0]+60); break; case F5: strcpy(keyboard,&func[0]+80); break; case F6: strcpy(keyboard,&func[0]+100); break; case F7: strcpy(keyboard,&func[0]+120); break; case F8: strcpy(keyboard,&func[0]+140); break; case F9: strcpy(keyboard,&func[0]+160); break; case F10: strcpy(keyboard,&func[0]+180); break; case F11: strcpy(keyboard,&func[0]+200); break; case F12: strcpy(keyboard,&func[0]+220); break; case SF1: strcpy(keyboard,&func[0]+240); break; case SF2: strcpy(keyboard,&func[0]+260); break; case SF3: strcpy(keyboard,&func[0]+280); break; case SF4: strcpy(keyboard,&func[0]+300); break; case SF5: strcpy(keyboard,&func[0]+320); break; case SF6: strcpy(keyboard,&func[0]+340); break; case SF7: strcpy(keyboard,&func[0]+360); break; case SF8: strcpy(keyboard,&func[0]+380); break; case SF9: strcpy(keyboard,&func[0]+400); break; case SF10: strcpy(keyboard,&func[0]+420); break; case SF11: strcpy(keyboard,&func[0]+440); break; case SF12: strcpy(keyboard,&func[0]+460); break; case CF1: strcpy(keyboard,&func[0]+480); break; case CF2: strcpy(keyboard,&func[0]+500); break; case CF3: strcpy(keyboard,&func[0]+520); break; case CF4: strcpy(keyboard,&func[0]+540); break; case CF5: strcpy(keyboard,&func[0]+560); break; case CF6: strcpy(keyboard,&func[0]+580); break; case CF7: strcpy(keyboard,&func[0]+600); break; case CF8: strcpy(keyboard,&func[0]+620); break; case CF9: strcpy(keyboard,&func[0]+640); break; case CF10: strcpy(keyboard,&func[0]+660); break; case CF11: strcpy(keyboard,&func[0]+680); break; case CF12: strcpy(keyboard,&func[0]+700); break; case AF1: strcpy(keyboard,&func[0]+720); break; case AF2: strcpy(keyboard,&func[0]+740); break; case AF3: strcpy(keyboard,&func[0]+760); break; case AF4: strcpy(keyboard,&func[0]+780); break; case AF5: strcpy(keyboard,&func[0]+800); break; case AF6: strcpy(keyboard,&func[0]+820); break; case AF7: strcpy(keyboard,&func[0]+840); break; case AF8: strcpy(keyboard,&func[0]+860); break; case AF9: strcpy(keyboard,&func[0]+880); break; case AF10: strcpy(keyboard,&func[0]+900); break; case AF11: strcpy(keyboard,&func[0]+920); break; case AF12: strcpy(keyboard,&func[0]+940); break; case PUP: /* roll screens */ if(--screen==0) screen=17; break; case PDN: /* roll screens */ if(++screen==18) screen=1; break; case HOME: /* main screen */ screen=1; break; case PRINT: stamp(); if((screen==1) /* main */ ||(screen==2) /* fault */ ||(screen==4) /* flow */ ||(screen==5) /* spare */ ||(screen==6) /* failure */ ||(screen==18)) /* start-up */ sl_ptst(ptbl2); /* no-green palette table */ sl_hpset(sl_itosp(1000)); /* left indent */ sl_vpset(sl_itosp(10000)); /* from top of page */ text(BLUE,500,15,"PRINTING SCREEN (WAIT)"); if(fail=sl_imprn(sl_itosp(6500),0L,0x03)) warn("VIDEO IMAGE PRINT WARNING"); sl_fprn("\f"); /* form feed */ sl_imfls(); /* flush */ ding(2); prompt("GRAPHICS SCREEN DUMP COMPLETE"); break; case REFRESH: oldscrn=0; /* refresh screen (RS) */ break; case REVERSE: reverse(); /* reverse video colors */ break; default: warn("UNDEFINED FUNCTION KEY"); refresh=1; fail=1; break; } return(fail); }