/* @(#)iie.c 17.1.1.1 (ESO-DMD) 01/25/02 17:34:27 */ /*=========================================================================== Copyright (C) 1995 European Southern Observatory (ESO) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Massachusetts Ave, Cambridge, MA 02139, USA. Correspondence concerning ESO-MIDAS should be addressed as follows: Internet e-mail: midas@eso.org Postal address: European Southern Observatory Data Management Division Karl-Schwarzschild-Strasse 2 D 85748 Garching bei Muenchen GERMANY ===========================================================================*/ /* ----------------------------------------------------------------- */ /* --------- IIE -------------------------------------------------- */ /* ----------------------------------------------------------------- */ /* file iie.c : contains the following `Escape' routines * * IIEGDB_C : Get a datablock from IDI server * IIESDB_C : Send a datablock to IDI server * * V 1.0 950203 Klaus Banse - ESO Garching 010514 last modif ************************************************************************* */ # include # include # include /* */ /************************************************************************ * IIEGDB_C routine : get a block of data from IDI server * * * synopsis IIEGDB_C(display,flag,auxid,cbuf,ibuf,rbuf) * * * int display; input display identifier * * int flag; input for different options * = 1 for memory data block * int auxid; input object id, * for flag = 1, it's the memory id * char *cbuf; output char. info * int *ibuf; output int info * float *rbuf; output float info * * the no. of elements in ibuf + rbuf depends upon flag * flag = 1, ibuf 17 elements, rbuf 8 elements * corresponding to the IDIMEMC keyword* ************************************************************************/ int IIEGDB_C(display,flag,auxid,cbuf,ibuf,rbuf) int display, flag, auxid, *ibuf; char *cbuf; float *rbuf; { CONF_DATA *conf; MEM_DATA *mem; ITT_DATA *itt; TLIST *tlist; GLIST *glist; int mm, i; if (flag == 1) /* handle the memory data stuff */ { if (ididev[display].opened == 0) return(DEVNOTOP); conf = ididev[display].confptr; if (conf->RGBmode == 1) { if (auxid == 3) auxid = conf->overlay; else auxid = 0; /* single memory for 3 channels */ } else { if ((auxid < 0) || (auxid >= conf->overlay)) return(ILLMEMID); } mem = conf->memory[auxid]; (void)strcpy(cbuf,mem->frame); *ibuf++ = mem->load_dir; *ibuf++ = mem->sspx; *ibuf++ = mem->sspy; *ibuf++ = mem->nsx; *ibuf++ = mem->nsy; *ibuf++ = mem->sfpx; *ibuf++ = mem->sfpy; *ibuf++ = mem->xscale; *ibuf++ = mem->yscale; *ibuf++ = mem->xscroll; *ibuf++ = mem->yscroll; *ibuf++ = mem->zoom; *ibuf++ = mem->zoom; /* same zoom in y */ *ibuf++ = mem->source; itt = mem->ittpntr; if (itt != (ITT_DATA *)0) *ibuf++ = itt->vis; else *ibuf++ = 0; *ibuf = 0; glist = mem->gpntr; if ((glist != (GLIST *)0) && (glist->geln > 0)) *ibuf = 1; else { tlist = mem->tpntr; if ((tlist != (TLIST *)0) && (tlist->teln > 0)) *ibuf = 1; } ibuf++; *ibuf = mem->plane_no; for (mm=0; mm<8; mm++) *rbuf++ = mem->rbuf[mm]; } else if (flag == 2) /* get complete setup */ { char *mytype, cc; mytype = cbuf; for (i=0; i= conf->overlay)) return(ILLMEMID); mem = conf->memory[auxid]; (void)strcpy(mem->frame,cbuf); ibuf++; /* we don't need to update mem->load_dir */ mem->sspx = *ibuf++; mem->sspy = *ibuf++; mem->nsx = *ibuf++; mem->nsy = *ibuf++; mem->sfpx = *ibuf++; mem->sfpy = *ibuf++; mem->xscale = *ibuf++; mem->yscale = *ibuf++; /* omit mem->xscroll, yscroll, zoom (2*), source, ITTvis and draw-flag */ mem->plane_no = *(ibuf+7); for (mm=0; mm<8; mm++) mem->rbuf[mm] = *rbuf++; } else if (flag > 100) { flag -= 100; do_misc(display,flag,auxid,cbuf,ibuf,rbuf); } return(II_SUCCESS); }