#include /* module flow9 */ #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include /*****************************************************************************/ flow(void) /* water flow diagram */ { char *list0[]= { "WATER LEVEL", "N2 PRESSURE", "WG N2", 0 }; int color,tcolor; screen=4; clkey(); if(screen!=oldscrn) refresh=1; if(refresh) { clear(); /* clear entire screen */ oldayt[0]=0; font(0); text(PALEBLUE,100,470,"WATER FLOW"); txnumber(); setcolor(GREY); line(20,120,20,400); /* vertical */ line(140,280,140,310); /* (RS) */ line(260,120,260,400); line(340,200,340,400); line(580,200,580,400); line(20,400,260,400); /* horizontal */ line(20,380,260,380); line(20,340,260,340); line(20,310,140,310); /* (RS) */ line(20,280,260,280); line(20,240,260,240); line(20,200,260,200); line(20,160,260,160); line(20,120,260,120); line(340,400,580,400); line(340,360,580,360); line(340,320,580,320); line(340,280,580,280); line(340,240,580,240); line(340,200,580,200); text(WHITE,270,400,"14 GPM"); tex(270,380,"14 GPM"); tex(270,340,"280 GPM"); tex(270,280,"280 GPM"); tex(270,240,"2 GPM"); tex(270,200,"2 GPM"); tex(270,160,"8 GPM"); tex(270,120,"8 GPM"); tex(590,400,"9.5 GPM"); tex(590,360,"9.5 GPM"); tex(590,320,"22 GPM"); tex(590,280,"4 GPM"); tex(590,240,"34 GPM"); tex(590,200,"8 GPM"); list(540,70,20,list0); } if(refresh||((status[5]&0x08)!=(statup[5]&0x08))) { color=hue(status[5]&0x08); /* socket */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,40,390,120,410,tcolor,"SOCKET 1"); box(color,160,370,240,390,tcolor,"SOCKET 2"); } if(refresh||((status[4]&0x10)!=(statup[4]&0x10))) { color=hue(status[4]&0x10); /* collector 1 */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,160,330,240,350,tcolor,"COLLECTOR 1"); box(color,40,330,120,350,tcolor,"WASTER"); } if(refresh||((status[4]&0x20)!=(statup[4]&0x20))) { color=hue(status[4]&0x20); /* collector 2 */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,40,300,100,320,tcolor,"KLY 1 DL"); box(color,40,270,100,290,tcolor,"KLY 2 DL"); box(color,160,270,240,290,tcolor,"COLLECTOR 2"); } if(refresh||((status[5]&0x40)!=(statup[5]&0x40))) { color=hue(status[5]&0x40); /* magnet 1 */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,40,230,120,250,tcolor,"MAGNET 1"); } if(refresh||((status[5]&0x80)!=(statup[5]&0x80))) { color=hue(status[5]&0x80); /* magnet 2 */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,160,190,240,210,tcolor,"MAGNET 2"); } if(refresh||((status[5]&0x10)!=(statup[5]&0x10))) { color=hue(status[5]&0x10); /* body 1 */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,40,150,120,170,tcolor,"BODY 1"); } if(refresh||((status[5]&0x20)!=(statup[5]&0x20))) { color=hue(status[5]&0x20); /* body 2 */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,160,110,240,130,tcolor,"BODY 2"); } if(refresh||((status[6]&0x01)!=(statup[6]&0x01))) { color=hue(status[6]&0x01); /* waveguide 1 */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,360,390,440,410,tcolor,"KLY 1 WG"); } if(refresh||((status[6]&0x02)!=(statup[6]&0x02))) { color=hue(status[6]&0x02); /* waveguide 2 */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,480,350,560,370,tcolor,"KLY 2 WG"); } if(refresh||((status[4]&0x80)!=(statup[4]&0x80))) /* (RS) */ { color=hue(status[4]&0x80); /* tx out wg (RS) */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,360,310,440,330,tcolor,"TX OUT WG"); } if(refresh||((status[5]&0x02)!=(statup[5]&0x02))) /* (RS) */ { color=hue(status[5]&0x02); /* tx room spares */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,420,270,520,290,tcolor,"TX ROOM SPARES"); } if(refresh||((status[5]&0x04)!=(statup[5]&0x04))) { color=hue(status[5]&0x04); /* feedroom wg */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,480,230,560,250,tcolor,"FEEDROOM WG"); } if(refresh||((status[5]&0x01)!=(statup[5]&0x01))) /* (RS) */ { color=hue(status[5]&0x01); /* feedroom spares (RS) */ if(color==YELLOW||color==RED) tcolor=BLACK; else tcolor=WHITE; box(color,360,190,470,210,tcolor,"FEEDROOM SPARES"); } if(refresh||((status[4]&0x08)!=(statup[4]&0x08))) swit(500,60,30,status[4]&0x08); /* water level prove */ if(refresh||((status[3]&0x40)!=(statup[3]&0x40))) swit(500,40,30,!(status[3]&0x40)); /* nitrogen pressure */ if(refresh||((status[4]&0x01)!=(statup[4]&0x01))) swit(500,20,30,!(status[4]&0x01)); /* wg nitrogen pressure */ refresh=0; oldscrn=screen; onmouse(); } /*****************************************************************************/ hue(state) /* select water flow color */ { int color,coolon; /* (RS) */ coolon=((status[4]&0x30)==(0x30)); /* collector flow (RS) */ if(state) { if(!coolon) /* cooling off? (RS) */ color=YELLOW; /* flow switch stuck on */ else color=GREEN; /* flow ok (RS) */ } else { if(coolon) /* cooling on? (RS) */ color=RED; /* flow off, not normal */ else color=GREY; /* flow off, normal (RS) */ } return(color); }