Capsim Block Documentation
This star is a programmable tap-off for data lines.
| Port | Type | Name | |
|---|---|---|---|
| 0 | float | x |
| Port | Type | Name | |
|---|---|---|---|
| 0 | float | y | |
| 1 | float | xmod |
| Num | Description | Type | Name | Default Value | |
|---|---|---|---|---|---|
| 0 | Number of samples to output | int | N | 30000 | |
| 1 | First sample to start from | int | first | 0 | |
| 2 | Gain | float | gain | 1. | |
| 3 | DC Offset | float | offset | 0. |
| Num | Type | Name | Initial Value | Description |
|---|---|---|---|---|
| 0 | int | count | N | |
| 1 | int | wait | first |
int i,j; float xval; |
|---|
for(i=MIN_AVAIL();i>0; --i) {
IT_IN(0);
xval = x(0);
if(IT_OUT(0)) {
KrnOverflow("tee",0);
return(99);
}
y(0) = xval;
if(wait-- <= 0 ) {
if(count-- > 0) {
if(IT_OUT(1)) {
KrnOverflow("tee",0);
return(99);
}
xmod(0) = gain * xval + offset;
}
}
}
return(0);
|
|---|
/* 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 */
|
|---|
/* tee.s */
/******************************************************************
tee()
*******************************************************************
This star is a programmable tap-off for data lines. It can be used
for example as a connector to print or plot stars. It is inserted
into a connection line between two stars; input data flows to Output 0
unchanged. Output 1 is a modified version of the input:
Parameter 1: (int) number samples to output; default => all
2: (int) index first sample; default => start from first
3: (float) gain; default => unity gain
4: (float) dc offset; default => no offset
Example: to printfile
^
|
|1
-------|
data line ---->0| tee |0-----> data line
|_______|
|
|---|