130 lines
5.2 KiB
TeX
130 lines
5.2 KiB
TeX
\subsection{Xytable}
|
|
Xytable is an object which holds a list of x-y values. This can be used as a
|
|
tool for doing very special scans or storing interesting data from command
|
|
files. This class allows to retrieve the data in uuencoded form which
|
|
is understood and displayed by the variable watcher SICS client. Furthermore
|
|
data can be written to a file. The table entries are kept in a linked
|
|
list in the following data structure.
|
|
|
|
The following data structures will be used:
|
|
\begin{flushleft} \small
|
|
\begin{minipage}{\linewidth} \label{scrap1}
|
|
$\langle$xydata {\footnotesize ?}$\rangle\equiv$
|
|
\vspace{-1ex}
|
|
\begin{list}{}{} \item
|
|
\mbox{}\verb@@\\
|
|
\mbox{}\verb@@\\
|
|
\mbox{}\verb@ typedef struct {@\\
|
|
\mbox{}\verb@ float x;@\\
|
|
\mbox{}\verb@ float y;@\\
|
|
\mbox{}\verb@ } TableEntry, *pTableEntry;@\\
|
|
\mbox{}\verb@@\\
|
|
\mbox{}\verb@ typedef struct __XYTABLE {@\\
|
|
\mbox{}\verb@ pObjectDescriptor pDes;@\\
|
|
\mbox{}\verb@ int iList; @\\
|
|
\mbox{}\verb@ int iCount;@\\
|
|
\mbox{}\verb@ }XYTable;@\\
|
|
\mbox{}\verb@@$\diamond$
|
|
\end{list}
|
|
\vspace{-1ex}
|
|
\footnotesize\addtolength{\baselineskip}{-1ex}
|
|
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
|
|
\item Macro referenced in scrap ?.
|
|
\end{list}
|
|
\end{minipage}\\[4ex]
|
|
\end{flushleft}
|
|
The entries in the TableEntry are self explianing: just the
|
|
values. The XYTable structure holds the following fields:
|
|
\begin{description}
|
|
\item[pDes] The standard object descriptor.
|
|
\item[iList] the handle for the lld-list holding the table entries.
|
|
\item[iCount] The number of entries in the table.
|
|
\end{description}
|
|
|
|
|
|
|
|
The following functions are defined:
|
|
\begin{flushleft} \small
|
|
\begin{minipage}{\linewidth} \label{scrap2}
|
|
$\langle$xyfunc {\footnotesize ?}$\rangle\equiv$
|
|
\vspace{-1ex}
|
|
\begin{list}{}{} \item
|
|
\mbox{}\verb@@\\
|
|
\mbox{}\verb@ typedef struct __XYTABLE *pXYTable;@\\
|
|
\mbox{}\verb@/*------------------------------------------------------------------------*/@\\
|
|
\mbox{}\verb@ int XYClear(pXYTable self);@\\
|
|
\mbox{}\verb@ int XYAdd(pXYTable self, float x, float y);@\\
|
|
\mbox{}\verb@ int XYWrite(pXYTable self, FILE *fd);@\\
|
|
\mbox{}\verb@ int XYSendUU(pXYTable self, SConnection *pCon);@\\
|
|
\mbox{}\verb@ int XYList(pXYTable self, SConnection *pCon);@\\
|
|
\mbox{}\verb@/*----------------------- interpreter interface --------------------------*/@\\
|
|
\mbox{}\verb@ int XYFactory(SConnection *pCon, SicsInterp *pSics, void *pData,@\\
|
|
\mbox{}\verb@ int argc, char *argv[]);@\\
|
|
\mbox{}\verb@ int XYAction(SConnection *pCon, SicsInterp *pSics, void *pData,@\\
|
|
\mbox{}\verb@ int argc, char *argv[]);@\\
|
|
\mbox{}\verb@@$\diamond$
|
|
\end{list}
|
|
\vspace{-1ex}
|
|
\footnotesize\addtolength{\baselineskip}{-1ex}
|
|
\begin{list}{}{\setlength{\itemsep}{-\parsep}\setlength{\itemindent}{-\leftmargin}}
|
|
\item Macro referenced in scrap ?.
|
|
\end{list}
|
|
\end{minipage}\\[4ex]
|
|
\end{flushleft}
|
|
Most functions take a pointer to an XYTbale data structure as fist
|
|
parameter and return 1 on success and 0 on failure. The functions are:
|
|
\begin{description}
|
|
\item[XYClear] clears all entries.
|
|
\item[XYAdd] appends a new pair of x and y values to the list.
|
|
\item[XYWrite] writes the XY-list to the file fd. This file must
|
|
already have been opened for writing by the calling routine.
|
|
[item[XYSendUU] sends the XY-table in uuencoded form compatible with
|
|
the SICS variabel watcher to connection pCon.
|
|
\item[XYList] prints the content of the XY-table to connection pCon.
|
|
\item[XYFactory] is the implentation of the installation command for
|
|
the SICS initialisation process.
|
|
\item[XYAction] implements the interface to the SICS interpreter for
|
|
the xytable command.
|
|
\end{description}
|
|
|
|
|
|
\begin{flushleft} \small
|
|
\begin{minipage}{\linewidth} \label{scrap3}
|
|
\verb@"xytable.i"@ {\footnotesize ? }$\equiv$
|
|
\vspace{-1ex}
|
|
\begin{list}{}{} \item
|
|
\mbox{}\verb@@\\
|
|
\mbox{}\verb@/*----------------------------------------------------------------------@\\
|
|
\mbox{}\verb@ Internal data structures for the XYTable class. Do not modify@\\
|
|
\mbox{}\verb@------------------------------------------------------------------------*/@\\
|
|
\mbox{}\verb@@$\langle$xydata {\footnotesize ?}$\rangle$\verb@@\\
|
|
\mbox{}\verb@@$\diamond$
|
|
\end{list}
|
|
\vspace{-2ex}
|
|
\end{minipage}\\[4ex]
|
|
\end{flushleft}
|
|
\begin{flushleft} \small
|
|
\begin{minipage}{\linewidth} \label{scrap4}
|
|
\verb@"xytable.h"@ {\footnotesize ? }$\equiv$
|
|
\vspace{-1ex}
|
|
\begin{list}{}{} \item
|
|
\mbox{}\verb@@\\
|
|
\mbox{}\verb@/*------------------------------------------------------------------------@\\
|
|
\mbox{}\verb@ X Y T A B L E @\\
|
|
\mbox{}\verb@@\\
|
|
\mbox{}\verb@ a helper class for holding an X-Y list of values.@\\
|
|
\mbox{}\verb@@\\
|
|
\mbox{}\verb@ copyright: see copyright.h@\\
|
|
\mbox{}\verb@@\\
|
|
\mbox{}\verb@ Mark Koennecke, June 1999@\\
|
|
\mbox{}\verb@----------------------------------------------------------------------------*/@\\
|
|
\mbox{}\verb@#ifndef XYTABLE@\\
|
|
\mbox{}\verb@#define XYTABLE@\\
|
|
\mbox{}\verb@@$\langle$xyfunc {\footnotesize ?}$\rangle$\verb@@\\
|
|
\mbox{}\verb@#endif@\\
|
|
\mbox{}\verb@@$\diamond$
|
|
\end{list}
|
|
\vspace{-2ex}
|
|
\end{minipage}\\[4ex]
|
|
\end{flushleft}
|