--- ray/src/hd/rholo4.c 1997/12/08 18:51:15 3.11 +++ ray/src/hd/rholo4.c 1997/12/22 17:42:03 3.16 @@ -13,7 +13,7 @@ static char SCCSid[] = "$SunId$ SGI"; #include #ifndef HDSUF -#define HDSUF ".hdisp" +#define HDSUF ".hdi" #endif static int inp_flags; @@ -105,12 +105,12 @@ int block; goto readerr; } switch (msg.type) { /* take appropriate action */ - case DR_BUNDLE: + case DR_BUNDLE: /* new bundle to calculate */ if (msg.nbytes != sizeof(PACKHEAD)) error(INTERNAL, "bad DR_BUNDLE from display process"); bundle_set(BS_ADD, (PACKHEAD *)buf, 1); break; - case DR_NEWSET: + case DR_NEWSET: /* new calculation set */ if (msg.nbytes % sizeof(PACKHEAD)) error(INTERNAL, "bad DR_NEWSET from display process"); disp_result(DS_STARTIMM, 0, NULL); @@ -118,15 +118,15 @@ int block; disp_result(DS_ENDIMM, 0, NULL); disp_flush(); break; - case DR_ADDSET: + case DR_ADDSET: /* add to calculation set */ if (msg.nbytes % sizeof(PACKHEAD)) error(INTERNAL, "bad DR_ADDSET from display process"); disp_result(DS_STARTIMM, 0, NULL); bundle_set(BS_ADD, (PACKHEAD *)buf, msg.nbytes/sizeof(PACKHEAD)); disp_result(DS_ENDIMM, 0, NULL); - disp_check(0); /* hack -- delete usu. follows add */ + disp_flush(); break; - case DR_ADJSET: + case DR_ADJSET: /* adjust calculation set members */ if (msg.nbytes % sizeof(PACKHEAD)) error(INTERNAL, "bad DR_ADJSET from display process"); disp_result(DS_STARTIMM, 0, NULL); @@ -134,22 +134,50 @@ int block; disp_result(DS_ENDIMM, 0, NULL); disp_flush(); break; - case DR_DELSET: + case DR_DELSET: /* delete from calculation set */ if (msg.nbytes % sizeof(PACKHEAD)) error(INTERNAL, "bad DR_DELSET from display process"); bundle_set(BS_DEL, (PACKHEAD *)buf, msg.nbytes/sizeof(PACKHEAD)); break; - case DR_ATTEN: + case DR_ATTEN: /* block for priority request */ if (msg.nbytes) error(INTERNAL, "bad DR_ATTEN from display process"); /* send acknowledgement */ disp_result(DS_ACKNOW, 0, NULL); return(disp_check(1)); /* block on following request */ - case DR_SHUTDOWN: + case DR_KILL: /* kill computation process(es) */ if (msg.nbytes) + error(INTERNAL, "bad DR_KILL from display process"); + if (nprocs > 0) + done_rtrace(); + else + error(WARNING, "no rtrace process to kill"); + break; + case DR_RESTART: /* restart computation process(es) */ + if (msg.nbytes) + error(INTERNAL, "bad DR_RESTART from display process"); + if (ncprocs > nprocs) + new_rtrace(); + else if (nprocs > 0) + error(WARNING, "rtrace already runnning"); + else + error(WARNING, "holodeck not open for writing"); + break; + case DR_CLOBBER: /* clobber holodeck */ + if (msg.nbytes) + error(INTERNAL, "bad DR_CLOBBER from display process"); + if (!force || !ncprocs) + error(WARNING, "request to clobber holodeck denied"); + else { + error(WARNING, "clobbering holodeck contents"); + hdclobber(NULL); + } + break; + case DR_SHUTDOWN: /* shut down program */ + if (msg.nbytes) error(INTERNAL, "bad DR_SHUTDOWN from display process"); return(0); /* zero return signals shutdown */ - case DR_NOOP: + case DR_NOOP: /* do nothing */ break; default: error(INTERNAL, "unrecognized request from display process");