Capsim Block Documentation
Scatter Probe
int samples; int i,j; int operState; FILE* file_F; complex val; char fname[100]; char curveTitle[80]; |
---|
/* * store as state the number of input/output buffers */ if((numberInputBuffers = NO_INPUT_BUFFERS()) <= 0) { fprintf(stderr,"scatter: no inputs connected\n"); return(2); } if((numberOutputBuffers = NO_OUTPUT_BUFFERS()) > numberInputBuffers) { fprintf(stderr,"scatter: too many outputs connected\n"); return(3); } if(numberInputBuffers > 2) { fprintf(stderr,"scatter: too many inputs connected\n"); return(3); } if(control && mode == DYNAMIC) { /* * allocate arrays */ xx_P = (float* )calloc(npts,sizeof(float)); if(xx_P == NULL) { fprintf(stderr,"Could not allocate space in scatter\n"); return(4); } yy_P = (float* )calloc(npts,sizeof(float)); if(yy_P == NULL) { fprintf(stderr,"Could not allocate space in scatter\n"); return(4); } } else if(control && mode == STATIC) { /* * allocate arrays */ xx_P = (float* )calloc(BLOCK_SIZE,sizeof(float)); if(xx_P == NULL) { fprintf(stderr,"Could not allocate space in scatter\n"); return(4); } yy_P = (float* )calloc(BLOCK_SIZE,sizeof(float)); if(yy_P == NULL) { fprintf(stderr,"Could not allocate space in scatter\n"); return(4); } } count = 0; totalCount = 0; switch(bufferType) { case COMPLEX_BUFFER: SET_CELL_SIZE_IN(0,sizeof(complex)); if(numberOutputBuffers == 1) SET_CELL_SIZE_IN(0,sizeof(complex)); break; case FLOAT_BUFFER: if(numberInputBuffers == 1) { SET_CELL_SIZE_IN(0,sizeof(float)); if(numberOutputBuffers == 1) SET_CELL_SIZE_OUT(0,sizeof(float)); } else { SET_CELL_SIZE_IN(0,sizeof(float)); SET_CELL_SIZE_IN(1,sizeof(float)); if(numberOutputBuffers == 2) { SET_CELL_SIZE_OUT(0,sizeof(float)); SET_CELL_SIZE_OUT(1,sizeof(float)); } } break; case INTEGER_BUFFER: if(numberInputBuffers == 1) { SET_CELL_SIZE_IN(0,sizeof(int)); if(numberOutputBuffers == 1) SET_CELL_SIZE_OUT(0,sizeof(int)); } else { SET_CELL_SIZE_IN(0,sizeof(int)); SET_CELL_SIZE_IN(1,sizeof(int)); if(numberOutputBuffers == 2) { SET_CELL_SIZE_OUT(0,sizeof(int)); SET_CELL_SIZE_OUT(1,sizeof(int)); } } break; default: fprintf(stderr,"Bad buffer type specified in scatter \n"); return(5); break; } |
---|
for(samples = MIN_AVAIL(); samples > 0; --samples) { for(i=0; i |
---|
if(control == 0) return(0); if((totalCount - skip) > 0 ) { { strcpy(fname,title); strcat(fname,".sct"); file_F = fopen(fname,"w"); for(i=0; i |
---|
/* Capsim (r) Text Mode Kernel (TMK) Star Library (Blocks) Copyright (C) 1989-2002 XCAD Corporation This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. This library 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 Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA http://capsimtmk.sourceforge.net XCAD Corporation Raleigh, North Carolina */ |
---|
/* scatter.s */ /********************************************************************** scatter() *********************************************************************** inputs: Two I and Q channels outputs: (optional feed-through of input channels) parameters: int npts, the number of points to plot int skip, number of points to skip before first plot file title, the title of the plot file x_axis, the title for the x_axis file y_axis, the title for the y_axis int plotQ 0=High, 1,2, ... Marker Type and Low Quality ************************************************************************* This routine will produce a scatter plot of the two input channels. channels. Optionally, the input channel data can 'flow through' to the correspondingly numbered output channel. This is useful if this star is to be placed in line in a simulation (e.g. probe). The first parameter represents the number of points plotted from each channel. Default is set to 128. The second parameter is the number of points to skip before the first plot set is presented. This enables skipping of any transient period. Default is set to (int 0). The third parameter represents the title for the plot. Default is set to "PLOT". The fourth parameter represents the title for the x_axis. Default is set to "X". The fifth parameter represents the title for the y_axis. Default is set to "Y". Programmer: Sasan Ardalan Date: 8/16/87 Modified: March 30, 1988 ,(RANobakht) Modified: L.J. Faber 1/3/89. Add flow through; general cleanup. Modified: Sasan Ardalan 1/20/89. dynamic allocation of arrays. */ |
---|