- Updates to the documentation

SKIPPED:
	psi/velodorn.h
This commit is contained in:
cvs
2003-12-11 10:52:00 +00:00
parent 350a5ad063
commit 3ce5573ea7
18 changed files with 281 additions and 110 deletions

View File

@ -10,6 +10,8 @@
Mark Koennecke, September 1997 Mark Koennecke, September 1997
Mark Koennecke, Aprl 2003
copyright: see copyright.h copyright: see copyright.h
----------------------------------------------------------------------------*/ ----------------------------------------------------------------------------*/
#ifndef SICSCONNECT #ifndef SICSCONNECT
@ -47,11 +49,11 @@ typedef int (*writeFunc)(struct __SConnection *pCon,
int eInterrupt; int eInterrupt;
int iUserRights; int iUserRights;
int inUse; int inUse;
int iDummy;
int iGrab; int iGrab;
SicsInterp *pSics; int iErrCode;
/* flag for parameter change */
int parameterChange; int parameterChange;
SicsInterp *pSics;
/* a FIFO */ /* a FIFO */
pCosta pStack; pCosta pStack;
@ -99,7 +101,7 @@ typedef int (*writeFunc)(struct __SConnection *pCon,
int SCRegister(SConnection *pCon, SicsInterp *pSics, int SCRegister(SConnection *pCon, SicsInterp *pSics,
void *pInter, long lID); void *pInter, long lID);
int SCUnregister(SConnection *pCon, void *pInter); int SCUnregister(SConnection *pCon, void *pInter);
/******************************* Interrupt *********************************/ /******************************* Error **************************************/
void SCSetInterrupt(SConnection *self, int eCode); void SCSetInterrupt(SConnection *self, int eCode);
int SCGetInterrupt(SConnection *self); int SCGetInterrupt(SConnection *self);
/****************************** Macro ***************************************/ /****************************** Macro ***************************************/

View File

@ -48,6 +48,7 @@ $\langle$VE {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@#define COUNTSTART 10@\\ \mbox{}\verb@#define COUNTSTART 10@\\
\mbox{}\verb@#define COUNTEND 11@\\ \mbox{}\verb@#define COUNTEND 11@\\
\mbox{}\verb@#define FILELOADED 12@\\ \mbox{}\verb@#define FILELOADED 12@\\
\mbox{}\verb@#define MOTEND 13@\\
\mbox{}\verb@@$\diamond$ \mbox{}\verb@@$\diamond$
\end{list} \end{list}
\vspace{-1ex} \vspace{-1ex}
@ -76,6 +77,7 @@ fiffractometer has been measured.
\item[COUNTSTART] is an event which signals the start of a counting \item[COUNTSTART] is an event which signals the start of a counting
operation. operation.
\item[COUNTEND] is an event signalling the end of a counting operation. \item[COUNTEND] is an event signalling the end of a counting operation.
\item[MOTEND] signals the end of a driving operation.
\end{description} \end{description}
Furthermore event contains system wide signal codes which are interpreted in Furthermore event contains system wide signal codes which are interpreted in

View File

@ -44,7 +44,7 @@ Clients can choose to suppress certain types of messages in order to
reduce I/O. reduce I/O.
The logic is mostly implemented in the The logic is mostly implemented in the
file static function SCNormalWrite. The follwoing conditions are file static function SCNormalWrite. The following conditions are
implemented: implemented:
\begin{itemize} \begin{itemize}
\item Any output is logged to the \item Any output is logged to the
@ -60,17 +60,17 @@ type error or warning are printed to the socket even during macro
evaluation. evaluation.
\item In the normal case the output is printed to the socket and all \item In the normal case the output is printed to the socket and all
log files configured for the connection. log files configured for the connection.
\item As of recent the output function can be modified by setting a
new function. One sich function exists which supresses all output to
the socket. This is done in order to help when the connection gets
lost. For instance with the cron command.
\end{itemize} \end{itemize}
This aspect of the connection object could do with a cleanup. A The above described the default. It turned out that many special cases
possible cleanup path is the implementation of the different output exist where it is feasible to suppress parts of the output. In order
strategies in different functions and devise a SCsetOutMode function which to take care of this, SCWrite calls a configurable write
switches between the various possibilities. Also, it can be argued if function. This write function can be retrieved and set with
the client specific log files are still needed. Then this part of the SCGetWriteFunc and SCSetWriteFunc. SCnoSock, SConlySock, SCnotWrite
code can be cleaned out as well. select some predefined write functions for special cases. Please note
that each of these calls switches the write function for the lifetime
of the connection or until it is set to a new one through
SCSetWriteFunc.
\subsubsection{Command Execution Path} \subsubsection{Command Execution Path}
@ -120,6 +120,9 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
\vspace{-1ex} \vspace{-1ex}
\begin{list}{}{} \item \begin{list}{}{} \item
\mbox{}\verb@@\\ \mbox{}\verb@@\\
\mbox{}\verb@typedef int (*writeFunc)(struct __SConnection *pCon,@\\
\mbox{}\verb@ char *pMessage, int iCode);@\\
\mbox{}\verb@@\\
\mbox{}\verb@ typedef struct __SConnection {@\\ \mbox{}\verb@ typedef struct __SConnection {@\\
\mbox{}\verb@ /* object basics */@\\ \mbox{}\verb@ /* object basics */@\\
\mbox{}\verb@ pObjectDescriptor pDes;@\\ \mbox{}\verb@ pObjectDescriptor pDes;@\\
@ -133,8 +136,7 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ int iTelnet;@\\ \mbox{}\verb@ int iTelnet;@\\
\mbox{}\verb@ int iOutput; @\\ \mbox{}\verb@ int iOutput; @\\
\mbox{}\verb@ int iFiles;@\\ \mbox{}\verb@ int iFiles;@\\
\mbox{}\verb@ int (*write)(struct __SConnection *pCon,@\\ \mbox{}\verb@ writeFunc write;@\\
\mbox{}\verb@ char *pMessage, int iCode);@\\
\mbox{}\verb@ mkChannel *pDataSock;@\\ \mbox{}\verb@ mkChannel *pDataSock;@\\
\mbox{}\verb@ char *pDataComp;@\\ \mbox{}\verb@ char *pDataComp;@\\
\mbox{}\verb@ int iDataPort;@\\ \mbox{}\verb@ int iDataPort;@\\
@ -146,6 +148,7 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ int iDummy;@\\ \mbox{}\verb@ int iDummy;@\\
\mbox{}\verb@ int iGrab;@\\ \mbox{}\verb@ int iGrab;@\\
\mbox{}\verb@ int iErrCode;@\\ \mbox{}\verb@ int iErrCode;@\\
\mbox{}\verb@ int parameterChange;@\\
\mbox{}\verb@ SicsInterp *pSics;@\\ \mbox{}\verb@ SicsInterp *pSics;@\\
\mbox{}\verb@ @\\ \mbox{}\verb@ @\\
\mbox{}\verb@ /* a FIFO */@\\ \mbox{}\verb@ /* a FIFO */@\\
@ -153,9 +156,15 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@@\\ \mbox{}\verb@@\\
\mbox{}\verb@ /* callback registry */@\\ \mbox{}\verb@ /* callback registry */@\\
\mbox{}\verb@ int iList;@\\ \mbox{}\verb@ int iList;@\\
\mbox{}\verb@ @\\ \mbox{}\verb@@\\
\mbox{}\verb@ /* Tasking Stuff */@\\ \mbox{}\verb@ /* Tasking Stuff */@\\
\mbox{}\verb@ int iEnd;@\\ \mbox{}\verb@ int iEnd;@\\
\mbox{}\verb@ /* for keeping track of the login@\\
\mbox{}\verb@ process on a non telnet connection.@\\
\mbox{}\verb@ Should only be used in SCTaskFunction@\\
\mbox{}\verb@ */@\\
\mbox{}\verb@ int iLogin;@\\
\mbox{}\verb@ time_t conStart;@\\
\mbox{}\verb@ }SConnection;@\\ \mbox{}\verb@ }SConnection;@\\
\mbox{}\verb@@$\diamond$ \mbox{}\verb@@$\diamond$
\end{list} \end{list}
@ -214,6 +223,10 @@ registered on this connection object.
\item[iEnd] iEnd is a flag which is usually 0. It is set by certain \item[iEnd] iEnd is a flag which is usually 0. It is set by certain
interrupts or if the connection is broken and causes the connection task to interrupts or if the connection is broken and causes the connection task to
end and the connection data structure to be removed from the system. end and the connection data structure to be removed from the system.
\item[iLogin] A flag which is set when we are not yet logged in.
\item[conStart] The time the connection was established. Used to
timeout connections when no valid login comes within a decent time
intervall.
\end{description} \end{description}
Quite a few places in SICS refer to this data structure directly, Quite a few places in SICS refer to this data structure directly,
without a function interface. The reason for this is performance. Therefore without a function interface. The reason for this is performance. Therefore
@ -247,6 +260,11 @@ $\langle$conint {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ int SCSendOK(SConnection *self);@\\ \mbox{}\verb@ int SCSendOK(SConnection *self);@\\
\mbox{}\verb@ int SCnoSock(SConnection *pCon);@\\ \mbox{}\verb@ int SCnoSock(SConnection *pCon);@\\
\mbox{}\verb@ int SCWriteUUencoded(SConnection *pCon, char *pName, void *iData, int iLen);@\\ \mbox{}\verb@ int SCWriteUUencoded(SConnection *pCon, char *pName, void *iData, int iLen);@\\
\mbox{}\verb@ int SCWriteZipped(SConnection *pCon, char *pName, void *pData, int iDataLen);@\\
\mbox{}\verb@ writeFunc SCGetWriteFunc(SConnection *pCon);@\\
\mbox{}\verb@ void SCSetWriteFunc(SConnection *pCon, writeFunc x);@\\
\mbox{}\verb@ int SCOnlySockWrite(SConnection *self, char *buffer, int iOut);@\\
\mbox{}\verb@ int SCNotWrite(SConnection *self, char *buffer, int iOut);@\\
\mbox{}\verb@/************************* CallBack *********************************** */@\\ \mbox{}\verb@/************************* CallBack *********************************** */@\\
\mbox{}\verb@ int SCRegister(SConnection *pCon, SicsInterp *pSics,@\\ \mbox{}\verb@ int SCRegister(SConnection *pCon, SicsInterp *pSics,@\\
\mbox{}\verb@ void *pInter, long lID);@\\ \mbox{}\verb@ void *pInter, long lID);@\\
@ -254,19 +272,20 @@ $\langle$conint {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@/******************************* Error **************************************/@\\ \mbox{}\verb@/******************************* Error **************************************/@\\
\mbox{}\verb@ void SCSetInterrupt(SConnection *self, int eCode);@\\ \mbox{}\verb@ void SCSetInterrupt(SConnection *self, int eCode);@\\
\mbox{}\verb@ int SCGetInterrupt(SConnection *self); @\\ \mbox{}\verb@ int SCGetInterrupt(SConnection *self); @\\
\mbox{}\verb@ void SCSetError(SConnection *pCon, int iCode);@\\
\mbox{}\verb@ int SCGetError(SConnection *pCon); @\\
\mbox{}\verb@/****************************** Macro ***************************************/@\\ \mbox{}\verb@/****************************** Macro ***************************************/@\\
\mbox{}\verb@ int SCinMacro(SConnection *pCon);@\\ \mbox{}\verb@ int SCinMacro(SConnection *pCon);@\\
\mbox{}\verb@ int SCsetMacro(SConnection *pCon, int iMode); @\\ \mbox{}\verb@ int SCsetMacro(SConnection *pCon, int iMode); @\\
\mbox{}\verb@@\\ \mbox{}\verb@/************************** parameters changed ? **************************/@\\
\mbox{}\verb@ void SCparChange(SConnection *pCon);@\\
\mbox{}\verb@/* *************************** Info *************************************** */@\\ \mbox{}\verb@/* *************************** Info *************************************** */@\\
\mbox{}\verb@ int SCGetRights(SConnection *self);@\\ \mbox{}\verb@ int SCGetRights(SConnection *self);@\\
\mbox{}\verb@ int SCSetRights(SConnection *pCon, int iNew);@\\ \mbox{}\verb@ int SCSetRights(SConnection *pCon, int iNew);@\\
\mbox{}\verb@ int SCMatchRights(SConnection *pCon, int iCode);@\\ \mbox{}\verb@ int SCMatchRights(SConnection *pCon, int iCode);@\\
\mbox{}\verb@ int SCGetOutClass(SConnection *self);@\\ \mbox{}\verb@ int SCGetOutClass(SConnection *self);@\\
\mbox{}\verb@ int SCGetGrab(SConnection *pCon);@\\ \mbox{}\verb@ int SCGetGrab(SConnection *pCon);@\\
\mbox{}\verb@@\\ \mbox{}\verb@/********************* simulation mode ************************************/@\\
\mbox{}\verb@ void SCSetSimMode(SConnection *pCon, int value);@\\
\mbox{}\verb@ int SCinSimMode(SConnection *pCon);@\\
\mbox{}\verb@/* **************************** Invocation ******************************** */@\\ \mbox{}\verb@/* **************************** Invocation ******************************** */@\\
\mbox{}\verb@ int SCInvoke(SConnection *self,SicsInterp *pInter,char *pCommand);@\\ \mbox{}\verb@ int SCInvoke(SConnection *self,SicsInterp *pInter,char *pCommand);@\\
\mbox{}\verb@ @\\ \mbox{}\verb@ @\\
@ -318,6 +337,20 @@ timeout period. pPrompt is the prompt for the client, pResult is the buffer
with the client reply. Maximum iLen bytes will be copied to with the client reply. Maximum iLen bytes will be copied to
pResult. Returns true (1) on a successfull read, else 0 (false). pResult. Returns true (1) on a successfull read, else 0 (false).
\item[SCSendOK] A short cut which sends OK to the client. \item[SCSendOK] A short cut which sends OK to the client.
\item[SCnoSock] Suppress output onto the client socket but keeps on
logging output to file. This is mostly used when the socket connection
closes with a batch file still being active.
\item[SCWriteUUencoded] sends iData in UU encoded form. For
communication with status clients.
\item[SCWriteZipped] writes pData in zipped form. Works only if the
connection is a plain connection, no telnet mode. This first sends a
line: SICSBIN ZIP dataname datalength followed by datalength bytes of
zipped data after the newline. Used for transferring larger amounts of
data to status clients.
\item[SCGetWriteFunc] gets the currently active write function.
\item[SCSetWriteFunc] sets a new write function.
\item[SCOnlySockWrite] write only to socket, not to log files.
\item[SCNotWrite] do not write at all.
\item[SCRegister] registers a callback with the connection. Parameters are: \item[SCRegister] registers a callback with the connection. Parameters are:
The interpreter to use, the interface with which the callback was The interpreter to use, the interface with which the callback was
registered and the ID of the callback. All automatic notifications to a registered and the ID of the callback. All automatic notifications to a
@ -329,11 +362,11 @@ happen.
\item[SCSetInterrupt] sets an interrupt on the connection. \item[SCSetInterrupt] sets an interrupt on the connection.
\item[SCGetInterrupt] retrives the current interrupt status of the \item[SCGetInterrupt] retrives the current interrupt status of the
connection. connection.
\item[SCSetError] sets an error code in the connection.
\item[SCGetError] retreives the current error code on the connection.
\item[SCinMacro] returns true if the connection is executing a tcl script, \item[SCinMacro] returns true if the connection is executing a tcl script,
returns false otherwise. returns false otherwise.
\item[SCsetMacro] sets the iMacro flag. \item[SCsetMacro] sets the iMacro flag.
\item[SCparChange] sets the flag that a parameter was changed and the
status file needs to be rewritten.
\item[SCGetRights] returns the current user rights associated with the \item[SCGetRights] returns the current user rights associated with the
connection. connection.
\item[SCGetGrab] gets the status of the control token for this connection. \item[SCGetGrab] gets the status of the control token for this connection.
@ -344,6 +377,8 @@ connection has the control token.
rights of the connection, 0 (false) otherwise. SCMatchRights also checks for rights of the connection, 0 (false) otherwise. SCMatchRights also checks for
the status of the control token. Suitable error messages are written to pCon the status of the control token. Suitable error messages are written to pCon
if the user rights do not match. if the user rights do not match.
\item[SCSetSimMode] sets this connection into simulation mode.
\item[SCinSimMode] checks for the simulation mode flag.
\item[SCInvoke] invokes pCommand in the SICS interpreter pSics for the \item[SCInvoke] invokes pCommand in the SICS interpreter pSics for the
connection pCon. This function also prints the executed command into connection pCon. This function also prints the executed command into
logfiles and into the commandlog. logfiles and into the commandlog.
@ -366,6 +401,8 @@ logfiles and into the commandlog.
\mbox{}\verb@@\\ \mbox{}\verb@@\\
\mbox{}\verb@ Mark Koennecke, September 1997@\\ \mbox{}\verb@ Mark Koennecke, September 1997@\\
\mbox{}\verb@@\\ \mbox{}\verb@@\\
\mbox{}\verb@ Mark Koennecke, Aprl 2003@\\
\mbox{}\verb@@\\
\mbox{}\verb@ copyright: see copyright.h@\\ \mbox{}\verb@ copyright: see copyright.h@\\
\mbox{}\verb@----------------------------------------------------------------------------*/@\\ \mbox{}\verb@----------------------------------------------------------------------------*/@\\
\mbox{}\verb@#ifndef SICSCONNECT@\\ \mbox{}\verb@#ifndef SICSCONNECT@\\

View File

@ -19,6 +19,7 @@ $\langle$servdat {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ mkChannel *pServerPort;@\\ \mbox{}\verb@ mkChannel *pServerPort;@\\
\mbox{}\verb@ pNetRead pReader;@\\ \mbox{}\verb@ pNetRead pReader;@\\
\mbox{}\verb@ int simMode;@\\ \mbox{}\verb@ int simMode;@\\
\mbox{}\verb@ SConnection *dummyCon;@\\
\mbox{}\verb@ } SicsServer;@\\ \mbox{}\verb@ } SicsServer;@\\
\mbox{}\verb@@$\diamond$ \mbox{}\verb@@$\diamond$
\end{list} \end{list}
@ -43,6 +44,8 @@ the SICS server is listening for connections.
communication object. communication object.
\item[simMode] a flag which is true when the SICS server is a simulation \item[simMode] a flag which is true when the SICS server is a simulation
server. server.
\item[dummyCon] A dummy connection to use when no other connection is
available for some reason.
\end{description} \end{description}

View File

@ -76,42 +76,76 @@ recommended.
\end{description} \end{description}
\subsection{Building SICS} \subsection{Building SICS}
This document describes how to build the SICS software and where to find it. A SICS distribution is best be obtained from the cvs
There are two sections: Building the SICS applications and building the Java repository. Access details are available on demand from Mark.Koennecke@psi.ch.
clients. For both categories tarballs with all necessary files can be A source distribution can be downloaded with:
found in the /data/lnslib/src/sics directory. There are two tar files: \begin{verbatim}
sics.tar which contains the sources for the SICS server and additional C or cvs checkout sics
F77 applications and java.tar which contains the code for the Java clients. \end{verbatim}
This creates a new directory, sics, and copies a lot of files.
\subsubsection{Building the SICS Server and Applications} \subsubsection{SICS Directory Layout}
The first step is to untar the sics.tar file. As a result a directory sics Underneath the sics directory there are further sub directories:
with several subdirectories will be created. These subdirectories are:
\begin{description} \begin{description}
\item[psi]PSI specific commands and code. \item[doc] Contains documentation. Further subdirectories to doc:
\item[hardsup] contains David Madens and other hardware drivers. \begin{description}
\item[motor] contains the unix version of David Madens el734\_test program. \item[user] User documentation.
\item[doc/programmer]holds programming documentation for SICS. \item[manager] Manager documentation
\item[doc/user] The html sources for the user documentation. Also everything \item[programmer] Reference documentation for SICS programmers.
necessary for creating the printed documentation.
\item[bin] Holds the final binary files.
\item[tcl] Some Tcl helper code.
\item[doc/manager]The SICS managers documentation.
\item[difrac] The DIFRAC four circle diffraction subsystem. This is
not used anymore.
\item[matrix] A matrix manipulation package.
\end{description} \end{description}
For most programs makefiles are provided. \item[matrix]A package for matrix manipulations
Makefiles may need a little editing to correct the location of libraries. \item[tcl]Tcl scripts
All necessary headers should be available in /data/lnslib/include and the \item[dummy]An example directory for a new site
libraries in /data/lnslib/lib. \item[psi]PSI specific parts of SICS
Building things within this hierarchy basically require to steps: \begin{description}
\begin{enumerate} \item[hardsup] Hardware support routines
\item cd into the hardsup and difrac directories and type make in \item[sinqhm]The vxWorks histogram memory software
each. This builds required libraries for linking other applications. \item[tecs]The tecs environment control software
\item cd into the directory of the program you wish to compile and type make. \item[motor]Utilities for the motor controller
For instance for building the SICServer, move into the main sics directory and \item[utils]various utilities
type make. \begin{description}
\end{enumerate} \item[check]The Tcl syntax checker for SICS
\end{description}
\end{description}
\end{description}
The sics directory is meant to contain the generic parts of
SICS. Then there are site specific directories (dummy, psi) which hold
code special for particular instruments or hardware. The selection for
which configuration SICS is being compiled is made in the makefile, by
linking against the appropriate site specific libraries.
\subsubsection{SICS Makefiles}
The SICS makefile system is not perfect but is far better then
compiling the whole stuff manually. There are various makefiles:
\begin{description}
\item[linux\_def, alpha\_def] contains the path to the HDF libraries,
the flags necessary to run sub makefiles in sub directories etc. This
is included by all other makefiles.
\item[make\_gen] and children contains most of the makefile content and
is included by the other makefiles.
\item[makefile\_linux, makefile\_alpha] are makefiles for their
respective platforms.
\end{description}
Some editing of makefiles will always be necessary. The path to the
HDF libraries has usually to be adapted in the \_def files. If there
is a different platfrom a new makefile has to be cloned from the
existing ones. In order to support a new site a new make\_gen and a new
makefile are have to be cloned. This system is similar in the
subdirectories to the SICS directory. Once this has been setup typing:
\begin{verbatim}
make -f makefile_alpha clean
\end{verbatim}
will clean all object files etc. and
\begin{verbatim}
make -f makefile_alpha
\end{verbatim}
will build everything. May be you need to replace alpha by linux on
some platforms. Please note, that I have been to lazy to generate
dependencies for all the SICS files. This means that if you make
changes to the major SICS header files (especially the kernel files)
it is better do recompile everything. Otherwise you might find
yourself chasing obscure bugs.
\subsubsection{Building Java Clients} \subsubsection{Building Java Clients}
Again the first step is the untaring of tha java.tar file. This creates a Again the first step is the untaring of tha java.tar file. This creates a
@ -139,6 +173,10 @@ Again the first step is the untaring of tha java.tar file. This creates a
\item[amor] The AMOR user interface program. \item[amor] The AMOR user interface program.
\item[tas] The Triple Axis user interface program. \item[tas] The Triple Axis user interface program.
\item[trics] The TRICS user interface program. \item[trics] The TRICS user interface program.
\item[JQF] A state machine framework used for implementing a new I/O
system.
\item[psi] The start of a new hierarchy of SICS applications and
library classes.
\end{description} \end{description}
Furthermore there are some Java source file in the main directory together Furthermore there are some Java source file in the main directory together
with some htm files and makefiles. For each of the Java clients a makefile with some htm files and makefiles. For each of the Java clients a makefile

View File

@ -46,7 +46,7 @@ Just one function is exported:
\mbox{}\verb@#ifndef SERIALSICSWAIT@\\ \mbox{}\verb@#ifndef SERIALSICSWAIT@\\
\mbox{}\verb@#define SERIALSICSWAIT@\\ \mbox{}\verb@#define SERIALSICSWAIT@\\
\mbox{}\verb@#include "sics.h"@\\ \mbox{}\verb@#include "sics.h"@\\
\mbox{}\verb@#include "hardsup/serialsinq.h"@\\ \mbox{}\verb@#include "psi/hardsup/serialsinq.h"@\\
\mbox{}\verb@ int SerialSicsExecute(void **pData, char *pCommand, char *pReply, @\\ \mbox{}\verb@ int SerialSicsExecute(void **pData, char *pCommand, char *pReply, @\\
\mbox{}\verb@ int iBufLen);@\\ \mbox{}\verb@ int iBufLen);@\\
\mbox{}\verb@@\\ \mbox{}\verb@@\\

View File

@ -27,7 +27,7 @@ $\langle$logint {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ int VarlogGetVal(pVarLog self, float *fValues);@\\ \mbox{}\verb@ int VarlogGetVal(pVarLog self, float *fValues);@\\
\mbox{}\verb@ int VarlogGetMean(pVarLog self, float *fMean, float *fStdDev);@\\ \mbox{}\verb@ int VarlogGetMean(pVarLog self, float *fMean, float *fStdDev);@\\
\mbox{}\verb@/*------------------------------ interpreter ---------------------------*/@\\ \mbox{}\verb@/*------------------------------ interpreter ---------------------------*/@\\
\mbox{}\verb@ int VarlogWrapper(pVarLog self, int *iSwitch, SConnection *pCon, @\\ \mbox{}\verb@ int VarlogWrapper(pVarLog self,SConnection *pCon, @\\
\mbox{}\verb@ char *subcommand, char *sub2,char *pVarName);@\\ \mbox{}\verb@ char *subcommand, char *sub2,char *pVarName);@\\
\mbox{}\verb@@$\diamond$ \mbox{}\verb@@$\diamond$
\end{list} \end{list}

View File

@ -79,6 +79,9 @@ for its number type.
<DD> determines the size of a single bin in histogram memory in bytes. <DD> determines the size of a single bin in histogram memory in bytes.
<DT>dim0, dim1, dim2, ... dimn <DT>dim0, dim1, dim2, ... dimn
<DD>define the logical dimensions of the histogram. <DD>define the logical dimensions of the histogram.
<dt>extrachan
<dd>Extra time channels as used at AMOR and SANS for time-of-flight
monitors. They get appended to the main hm data but are treated separately.
</DL> </DL>
</p> </p>
<p> <p>

10
event.h
View File

@ -1,5 +1,5 @@
#line 77 "event.w" #line 79 "event.w"
/*---------------------------------------------------------------------------- /*----------------------------------------------------------------------------
E V E N T E V E N T
@ -18,7 +18,7 @@
int Text2Event(char *pText); int Text2Event(char *pText);
#line 90 "event.w" #line 92 "event.w"
@ -39,18 +39,18 @@
#define FILELOADED 12 #define FILELOADED 12
#define MOTEND 13 #define MOTEND 13
#line 92 "event.w" #line 94 "event.w"
/*--------------- Signals for the Signalfunction of each task ------------*/ /*--------------- Signals for the Signalfunction of each task ------------*/
#line 62 "event.w" #line 64 "event.w"
#define SICSINT 300 #define SICSINT 300
#define SICSBROADCAST 301 #define SICSBROADCAST 301
#define TOKENGRAB 302 #define TOKENGRAB 302
#define TOKENRELEASE 303 #define TOKENRELEASE 303
#line 95 "event.w" #line 97 "event.w"
#endif #endif

View File

@ -48,6 +48,7 @@ $\langle$VE {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@#define COUNTSTART 10@\\ \mbox{}\verb@#define COUNTSTART 10@\\
\mbox{}\verb@#define COUNTEND 11@\\ \mbox{}\verb@#define COUNTEND 11@\\
\mbox{}\verb@#define FILELOADED 12@\\ \mbox{}\verb@#define FILELOADED 12@\\
\mbox{}\verb@#define MOTEND 13@\\
\mbox{}\verb@@$\diamond$ \mbox{}\verb@@$\diamond$
\end{list} \end{list}
\vspace{-1ex} \vspace{-1ex}
@ -76,6 +77,7 @@ fiffractometer has been measured.
\item[COUNTSTART] is an event which signals the start of a counting \item[COUNTSTART] is an event which signals the start of a counting
operation. operation.
\item[COUNTEND] is an event signalling the end of a counting operation. \item[COUNTEND] is an event signalling the end of a counting operation.
\item[MOTEND] signals the end of a driving operation.
\end{description} \end{description}
Furthermore event contains system wide signal codes which are interpreted in Furthermore event contains system wide signal codes which are interpreted in

View File

@ -31,6 +31,7 @@ if the event code is not known, else the apropriate event code.
#define COUNTSTART 10 #define COUNTSTART 10
#define COUNTEND 11 #define COUNTEND 11
#define FILELOADED 12 #define FILELOADED 12
#define MOTEND 13
@} @}
\begin{description} \begin{description}
\item[VALUECHANGE] This is a variable changing its value. As event data a pointer to the \item[VALUECHANGE] This is a variable changing its value. As event data a pointer to the
@ -51,6 +52,7 @@ fiffractometer has been measured.
\item[COUNTSTART] is an event which signals the start of a counting \item[COUNTSTART] is an event which signals the start of a counting
operation. operation.
\item[COUNTEND] is an event signalling the end of a counting operation. \item[COUNTEND] is an event signalling the end of a counting operation.
\item[MOTEND] signals the end of a driving operation.
\end{description} \end{description}
Furthermore event contains system wide signal codes which are interpreted in Furthermore event contains system wide signal codes which are interpreted in

View File

@ -15,6 +15,7 @@ The modules data structure:
int nSlaves; int nSlaves;
float fPreset; float fPreset;
CounterMode eMode; CounterMode eMode;
pICallBack pCall;
} HMcontrol, *pHMcontrol; } HMcontrol, *pHMcontrol;
@} @}
The fields are: The fields are:
@ -27,6 +28,7 @@ is always the neutron counter.
\item[nSlaves] The number of active slaves. \item[nSlaves] The number of active slaves.
\item[fPreset] The counting preset. \item[fPreset] The counting preset.
\item[eMode] The counting mode. \item[eMode] The counting mode.
\item[pCall] The callback interface.
\end{description} \end{description}

View File

@ -44,7 +44,7 @@ Clients can choose to suppress certain types of messages in order to
reduce I/O. reduce I/O.
The logic is mostly implemented in the The logic is mostly implemented in the
file static function SCNormalWrite. The follwoing conditions are file static function SCNormalWrite. The following conditions are
implemented: implemented:
\begin{itemize} \begin{itemize}
\item Any output is logged to the \item Any output is logged to the
@ -60,17 +60,17 @@ type error or warning are printed to the socket even during macro
evaluation. evaluation.
\item In the normal case the output is printed to the socket and all \item In the normal case the output is printed to the socket and all
log files configured for the connection. log files configured for the connection.
\item As of recent the output function can be modified by setting a
new function. One sich function exists which supresses all output to
the socket. This is done in order to help when the connection gets
lost. For instance with the cron command.
\end{itemize} \end{itemize}
This aspect of the connection object could do with a cleanup. A The above described the default. It turned out that many special cases
possible cleanup path is the implementation of the different output exist where it is feasible to suppress parts of the output. In order
strategies in different functions and devise a SCsetOutMode function which to take care of this, SCWrite calls a configurable write
switches between the various possibilities. Also, it can be argued if function. This write function can be retrieved and set with
the client specific log files are still needed. Then this part of the SCGetWriteFunc and SCSetWriteFunc. SCnoSock, SConlySock, SCnotWrite
code can be cleaned out as well. select some predefined write functions for special cases. Please note
that each of these calls switches the write function for the lifetime
of the connection or until it is set to a new one through
SCSetWriteFunc.
\subsubsection{Command Execution Path} \subsubsection{Command Execution Path}
@ -120,6 +120,9 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
\vspace{-1ex} \vspace{-1ex}
\begin{list}{}{} \item \begin{list}{}{} \item
\mbox{}\verb@@\\ \mbox{}\verb@@\\
\mbox{}\verb@typedef int (*writeFunc)(struct __SConnection *pCon,@\\
\mbox{}\verb@ char *pMessage, int iCode);@\\
\mbox{}\verb@@\\
\mbox{}\verb@ typedef struct __SConnection {@\\ \mbox{}\verb@ typedef struct __SConnection {@\\
\mbox{}\verb@ /* object basics */@\\ \mbox{}\verb@ /* object basics */@\\
\mbox{}\verb@ pObjectDescriptor pDes;@\\ \mbox{}\verb@ pObjectDescriptor pDes;@\\
@ -133,8 +136,7 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ int iTelnet;@\\ \mbox{}\verb@ int iTelnet;@\\
\mbox{}\verb@ int iOutput; @\\ \mbox{}\verb@ int iOutput; @\\
\mbox{}\verb@ int iFiles;@\\ \mbox{}\verb@ int iFiles;@\\
\mbox{}\verb@ int (*write)(struct __SConnection *pCon,@\\ \mbox{}\verb@ writeFunc write;@\\
\mbox{}\verb@ char *pMessage, int iCode);@\\
\mbox{}\verb@ mkChannel *pDataSock;@\\ \mbox{}\verb@ mkChannel *pDataSock;@\\
\mbox{}\verb@ char *pDataComp;@\\ \mbox{}\verb@ char *pDataComp;@\\
\mbox{}\verb@ int iDataPort;@\\ \mbox{}\verb@ int iDataPort;@\\
@ -146,6 +148,7 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ int iDummy;@\\ \mbox{}\verb@ int iDummy;@\\
\mbox{}\verb@ int iGrab;@\\ \mbox{}\verb@ int iGrab;@\\
\mbox{}\verb@ int iErrCode;@\\ \mbox{}\verb@ int iErrCode;@\\
\mbox{}\verb@ int parameterChange;@\\
\mbox{}\verb@ SicsInterp *pSics;@\\ \mbox{}\verb@ SicsInterp *pSics;@\\
\mbox{}\verb@ @\\ \mbox{}\verb@ @\\
\mbox{}\verb@ /* a FIFO */@\\ \mbox{}\verb@ /* a FIFO */@\\
@ -153,9 +156,15 @@ $\langle$condat {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@@\\ \mbox{}\verb@@\\
\mbox{}\verb@ /* callback registry */@\\ \mbox{}\verb@ /* callback registry */@\\
\mbox{}\verb@ int iList;@\\ \mbox{}\verb@ int iList;@\\
\mbox{}\verb@ @\\ \mbox{}\verb@@\\
\mbox{}\verb@ /* Tasking Stuff */@\\ \mbox{}\verb@ /* Tasking Stuff */@\\
\mbox{}\verb@ int iEnd;@\\ \mbox{}\verb@ int iEnd;@\\
\mbox{}\verb@ /* for keeping track of the login@\\
\mbox{}\verb@ process on a non telnet connection.@\\
\mbox{}\verb@ Should only be used in SCTaskFunction@\\
\mbox{}\verb@ */@\\
\mbox{}\verb@ int iLogin;@\\
\mbox{}\verb@ time_t conStart;@\\
\mbox{}\verb@ }SConnection;@\\ \mbox{}\verb@ }SConnection;@\\
\mbox{}\verb@@$\diamond$ \mbox{}\verb@@$\diamond$
\end{list} \end{list}
@ -214,6 +223,10 @@ registered on this connection object.
\item[iEnd] iEnd is a flag which is usually 0. It is set by certain \item[iEnd] iEnd is a flag which is usually 0. It is set by certain
interrupts or if the connection is broken and causes the connection task to interrupts or if the connection is broken and causes the connection task to
end and the connection data structure to be removed from the system. end and the connection data structure to be removed from the system.
\item[iLogin] A flag which is set when we are not yet logged in.
\item[conStart] The time the connection was established. Used to
timeout connections when no valid login comes within a decent time
intervall.
\end{description} \end{description}
Quite a few places in SICS refer to this data structure directly, Quite a few places in SICS refer to this data structure directly,
without a function interface. The reason for this is performance. Therefore without a function interface. The reason for this is performance. Therefore
@ -247,6 +260,11 @@ $\langle$conint {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ int SCSendOK(SConnection *self);@\\ \mbox{}\verb@ int SCSendOK(SConnection *self);@\\
\mbox{}\verb@ int SCnoSock(SConnection *pCon);@\\ \mbox{}\verb@ int SCnoSock(SConnection *pCon);@\\
\mbox{}\verb@ int SCWriteUUencoded(SConnection *pCon, char *pName, void *iData, int iLen);@\\ \mbox{}\verb@ int SCWriteUUencoded(SConnection *pCon, char *pName, void *iData, int iLen);@\\
\mbox{}\verb@ int SCWriteZipped(SConnection *pCon, char *pName, void *pData, int iDataLen);@\\
\mbox{}\verb@ writeFunc SCGetWriteFunc(SConnection *pCon);@\\
\mbox{}\verb@ void SCSetWriteFunc(SConnection *pCon, writeFunc x);@\\
\mbox{}\verb@ int SCOnlySockWrite(SConnection *self, char *buffer, int iOut);@\\
\mbox{}\verb@ int SCNotWrite(SConnection *self, char *buffer, int iOut);@\\
\mbox{}\verb@/************************* CallBack *********************************** */@\\ \mbox{}\verb@/************************* CallBack *********************************** */@\\
\mbox{}\verb@ int SCRegister(SConnection *pCon, SicsInterp *pSics,@\\ \mbox{}\verb@ int SCRegister(SConnection *pCon, SicsInterp *pSics,@\\
\mbox{}\verb@ void *pInter, long lID);@\\ \mbox{}\verb@ void *pInter, long lID);@\\
@ -254,19 +272,20 @@ $\langle$conint {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@/******************************* Error **************************************/@\\ \mbox{}\verb@/******************************* Error **************************************/@\\
\mbox{}\verb@ void SCSetInterrupt(SConnection *self, int eCode);@\\ \mbox{}\verb@ void SCSetInterrupt(SConnection *self, int eCode);@\\
\mbox{}\verb@ int SCGetInterrupt(SConnection *self); @\\ \mbox{}\verb@ int SCGetInterrupt(SConnection *self); @\\
\mbox{}\verb@ void SCSetError(SConnection *pCon, int iCode);@\\
\mbox{}\verb@ int SCGetError(SConnection *pCon); @\\
\mbox{}\verb@/****************************** Macro ***************************************/@\\ \mbox{}\verb@/****************************** Macro ***************************************/@\\
\mbox{}\verb@ int SCinMacro(SConnection *pCon);@\\ \mbox{}\verb@ int SCinMacro(SConnection *pCon);@\\
\mbox{}\verb@ int SCsetMacro(SConnection *pCon, int iMode); @\\ \mbox{}\verb@ int SCsetMacro(SConnection *pCon, int iMode); @\\
\mbox{}\verb@@\\ \mbox{}\verb@/************************** parameters changed ? **************************/@\\
\mbox{}\verb@ void SCparChange(SConnection *pCon);@\\
\mbox{}\verb@/* *************************** Info *************************************** */@\\ \mbox{}\verb@/* *************************** Info *************************************** */@\\
\mbox{}\verb@ int SCGetRights(SConnection *self);@\\ \mbox{}\verb@ int SCGetRights(SConnection *self);@\\
\mbox{}\verb@ int SCSetRights(SConnection *pCon, int iNew);@\\ \mbox{}\verb@ int SCSetRights(SConnection *pCon, int iNew);@\\
\mbox{}\verb@ int SCMatchRights(SConnection *pCon, int iCode);@\\ \mbox{}\verb@ int SCMatchRights(SConnection *pCon, int iCode);@\\
\mbox{}\verb@ int SCGetOutClass(SConnection *self);@\\ \mbox{}\verb@ int SCGetOutClass(SConnection *self);@\\
\mbox{}\verb@ int SCGetGrab(SConnection *pCon);@\\ \mbox{}\verb@ int SCGetGrab(SConnection *pCon);@\\
\mbox{}\verb@@\\ \mbox{}\verb@/********************* simulation mode ************************************/@\\
\mbox{}\verb@ void SCSetSimMode(SConnection *pCon, int value);@\\
\mbox{}\verb@ int SCinSimMode(SConnection *pCon);@\\
\mbox{}\verb@/* **************************** Invocation ******************************** */@\\ \mbox{}\verb@/* **************************** Invocation ******************************** */@\\
\mbox{}\verb@ int SCInvoke(SConnection *self,SicsInterp *pInter,char *pCommand);@\\ \mbox{}\verb@ int SCInvoke(SConnection *self,SicsInterp *pInter,char *pCommand);@\\
\mbox{}\verb@ @\\ \mbox{}\verb@ @\\
@ -318,6 +337,20 @@ timeout period. pPrompt is the prompt for the client, pResult is the buffer
with the client reply. Maximum iLen bytes will be copied to with the client reply. Maximum iLen bytes will be copied to
pResult. Returns true (1) on a successfull read, else 0 (false). pResult. Returns true (1) on a successfull read, else 0 (false).
\item[SCSendOK] A short cut which sends OK to the client. \item[SCSendOK] A short cut which sends OK to the client.
\item[SCnoSock] Suppress output onto the client socket but keeps on
logging output to file. This is mostly used when the socket connection
closes with a batch file still being active.
\item[SCWriteUUencoded] sends iData in UU encoded form. For
communication with status clients.
\item[SCWriteZipped] writes pData in zipped form. Works only if the
connection is a plain connection, no telnet mode. This first sends a
line: SICSBIN ZIP dataname datalength followed by datalength bytes of
zipped data after the newline. Used for transferring larger amounts of
data to status clients.
\item[SCGetWriteFunc] gets the currently active write function.
\item[SCSetWriteFunc] sets a new write function.
\item[SCOnlySockWrite] write only to socket, not to log files.
\item[SCNotWrite] do not write at all.
\item[SCRegister] registers a callback with the connection. Parameters are: \item[SCRegister] registers a callback with the connection. Parameters are:
The interpreter to use, the interface with which the callback was The interpreter to use, the interface with which the callback was
registered and the ID of the callback. All automatic notifications to a registered and the ID of the callback. All automatic notifications to a
@ -329,11 +362,11 @@ happen.
\item[SCSetInterrupt] sets an interrupt on the connection. \item[SCSetInterrupt] sets an interrupt on the connection.
\item[SCGetInterrupt] retrives the current interrupt status of the \item[SCGetInterrupt] retrives the current interrupt status of the
connection. connection.
\item[SCSetError] sets an error code in the connection.
\item[SCGetError] retreives the current error code on the connection.
\item[SCinMacro] returns true if the connection is executing a tcl script, \item[SCinMacro] returns true if the connection is executing a tcl script,
returns false otherwise. returns false otherwise.
\item[SCsetMacro] sets the iMacro flag. \item[SCsetMacro] sets the iMacro flag.
\item[SCparChange] sets the flag that a parameter was changed and the
status file needs to be rewritten.
\item[SCGetRights] returns the current user rights associated with the \item[SCGetRights] returns the current user rights associated with the
connection. connection.
\item[SCGetGrab] gets the status of the control token for this connection. \item[SCGetGrab] gets the status of the control token for this connection.
@ -344,6 +377,8 @@ connection has the control token.
rights of the connection, 0 (false) otherwise. SCMatchRights also checks for rights of the connection, 0 (false) otherwise. SCMatchRights also checks for
the status of the control token. Suitable error messages are written to pCon the status of the control token. Suitable error messages are written to pCon
if the user rights do not match. if the user rights do not match.
\item[SCSetSimMode] sets this connection into simulation mode.
\item[SCinSimMode] checks for the simulation mode flag.
\item[SCInvoke] invokes pCommand in the SICS interpreter pSics for the \item[SCInvoke] invokes pCommand in the SICS interpreter pSics for the
connection pCon. This function also prints the executed command into connection pCon. This function also prints the executed command into
logfiles and into the commandlog. logfiles and into the commandlog.
@ -366,6 +401,8 @@ logfiles and into the commandlog.
\mbox{}\verb@@\\ \mbox{}\verb@@\\
\mbox{}\verb@ Mark Koennecke, September 1997@\\ \mbox{}\verb@ Mark Koennecke, September 1997@\\
\mbox{}\verb@@\\ \mbox{}\verb@@\\
\mbox{}\verb@ Mark Koennecke, Aprl 2003@\\
\mbox{}\verb@@\\
\mbox{}\verb@ copyright: see copyright.h@\\ \mbox{}\verb@ copyright: see copyright.h@\\
\mbox{}\verb@----------------------------------------------------------------------------*/@\\ \mbox{}\verb@----------------------------------------------------------------------------*/@\\
\mbox{}\verb@#ifndef SICSCONNECT@\\ \mbox{}\verb@#ifndef SICSCONNECT@\\

View File

@ -44,7 +44,7 @@ Clients can choose to suppress certain types of messages in order to
reduce I/O. reduce I/O.
The logic is mostly implemented in the The logic is mostly implemented in the
file static function SCNormalWrite. The follwoing conditions are file static function SCNormalWrite. The following conditions are
implemented: implemented:
\begin{itemize} \begin{itemize}
\item Any output is logged to the \item Any output is logged to the
@ -60,17 +60,17 @@ type error or warning are printed to the socket even during macro
evaluation. evaluation.
\item In the normal case the output is printed to the socket and all \item In the normal case the output is printed to the socket and all
log files configured for the connection. log files configured for the connection.
\item As of recent the output function can be modified by setting a
new function. One sich function exists which supresses all output to
the socket. This is done in order to help when the connection gets
lost. For instance with the cron command.
\end{itemize} \end{itemize}
This aspect of the connection object could do with a cleanup. A The above described the default. It turned out that many special cases
possible cleanup path is the implementation of the different output exist where it is feasible to suppress parts of the output. In order
strategies in different functions and devise a SCsetOutMode function which to take care of this, SCWrite calls a configurable write
switches between the various possibilities. Also, it can be argued if function. This write function can be retrieved and set with
the client specific log files are still needed. Then this part of the SCGetWriteFunc and SCSetWriteFunc. SCnoSock, SConlySock, SCnotWrite
code can be cleaned out as well. select some predefined write functions for special cases. Please note
that each of these calls switches the write function for the lifetime
of the connection or until it is set to a new one through
SCSetWriteFunc.
\subsubsection{Command Execution Path} \subsubsection{Command Execution Path}
@ -115,6 +115,9 @@ Given the plethora of things to take care of, each connection is
represented by a rather large data structure. represented by a rather large data structure.
@d condat @{ @d condat @{
typedef int (*writeFunc)(struct __SConnection *pCon,
char *pMessage, int iCode);
typedef struct __SConnection { typedef struct __SConnection {
/* object basics */ /* object basics */
pObjectDescriptor pDes; pObjectDescriptor pDes;
@ -128,8 +131,7 @@ represented by a rather large data structure.
int iTelnet; int iTelnet;
int iOutput; int iOutput;
int iFiles; int iFiles;
int (*write)(struct __SConnection *pCon, writeFunc write;
char *pMessage, int iCode);
mkChannel *pDataSock; mkChannel *pDataSock;
char *pDataComp; char *pDataComp;
int iDataPort; int iDataPort;
@ -141,6 +143,7 @@ represented by a rather large data structure.
int iDummy; int iDummy;
int iGrab; int iGrab;
int iErrCode; int iErrCode;
int parameterChange;
SicsInterp *pSics; SicsInterp *pSics;
/* a FIFO */ /* a FIFO */
@ -151,6 +154,12 @@ represented by a rather large data structure.
/* Tasking Stuff */ /* Tasking Stuff */
int iEnd; int iEnd;
/* for keeping track of the login
process on a non telnet connection.
Should only be used in SCTaskFunction
*/
int iLogin;
time_t conStart;
}SConnection; }SConnection;
@} @}
@ -202,6 +211,10 @@ registered on this connection object.
\item[iEnd] iEnd is a flag which is usually 0. It is set by certain \item[iEnd] iEnd is a flag which is usually 0. It is set by certain
interrupts or if the connection is broken and causes the connection task to interrupts or if the connection is broken and causes the connection task to
end and the connection data structure to be removed from the system. end and the connection data structure to be removed from the system.
\item[iLogin] A flag which is set when we are not yet logged in.
\item[conStart] The time the connection was established. Used to
timeout connections when no valid login comes within a decent time
intervall.
\end{description} \end{description}
Quite a few places in SICS refer to this data structure directly, Quite a few places in SICS refer to this data structure directly,
without a function interface. The reason for this is performance. Therefore without a function interface. The reason for this is performance. Therefore
@ -230,6 +243,11 @@ The interface to this data structure is defined by the following functions:
int SCSendOK(SConnection *self); int SCSendOK(SConnection *self);
int SCnoSock(SConnection *pCon); int SCnoSock(SConnection *pCon);
int SCWriteUUencoded(SConnection *pCon, char *pName, void *iData, int iLen); int SCWriteUUencoded(SConnection *pCon, char *pName, void *iData, int iLen);
int SCWriteZipped(SConnection *pCon, char *pName, void *pData, int iDataLen);
writeFunc SCGetWriteFunc(SConnection *pCon);
void SCSetWriteFunc(SConnection *pCon, writeFunc x);
int SCOnlySockWrite(SConnection *self, char *buffer, int iOut);
int SCNotWrite(SConnection *self, char *buffer, int iOut);
/************************* CallBack *********************************** */ /************************* CallBack *********************************** */
int SCRegister(SConnection *pCon, SicsInterp *pSics, int SCRegister(SConnection *pCon, SicsInterp *pSics,
void *pInter, long lID); void *pInter, long lID);
@ -237,19 +255,20 @@ The interface to this data structure is defined by the following functions:
/******************************* Error **************************************/ /******************************* Error **************************************/
void SCSetInterrupt(SConnection *self, int eCode); void SCSetInterrupt(SConnection *self, int eCode);
int SCGetInterrupt(SConnection *self); int SCGetInterrupt(SConnection *self);
void SCSetError(SConnection *pCon, int iCode);
int SCGetError(SConnection *pCon);
/****************************** Macro ***************************************/ /****************************** Macro ***************************************/
int SCinMacro(SConnection *pCon); int SCinMacro(SConnection *pCon);
int SCsetMacro(SConnection *pCon, int iMode); int SCsetMacro(SConnection *pCon, int iMode);
/************************** parameters changed ? **************************/
void SCparChange(SConnection *pCon);
/* *************************** Info *************************************** */ /* *************************** Info *************************************** */
int SCGetRights(SConnection *self); int SCGetRights(SConnection *self);
int SCSetRights(SConnection *pCon, int iNew); int SCSetRights(SConnection *pCon, int iNew);
int SCMatchRights(SConnection *pCon, int iCode); int SCMatchRights(SConnection *pCon, int iCode);
int SCGetOutClass(SConnection *self); int SCGetOutClass(SConnection *self);
int SCGetGrab(SConnection *pCon); int SCGetGrab(SConnection *pCon);
/********************* simulation mode ************************************/
void SCSetSimMode(SConnection *pCon, int value);
int SCinSimMode(SConnection *pCon);
/* **************************** Invocation ******************************** */ /* **************************** Invocation ******************************** */
int SCInvoke(SConnection *self,SicsInterp *pInter,char *pCommand); int SCInvoke(SConnection *self,SicsInterp *pInter,char *pCommand);
@ -293,6 +312,20 @@ timeout period. pPrompt is the prompt for the client, pResult is the buffer
with the client reply. Maximum iLen bytes will be copied to with the client reply. Maximum iLen bytes will be copied to
pResult. Returns true (1) on a successfull read, else 0 (false). pResult. Returns true (1) on a successfull read, else 0 (false).
\item[SCSendOK] A short cut which sends OK to the client. \item[SCSendOK] A short cut which sends OK to the client.
\item[SCnoSock] Suppress output onto the client socket but keeps on
logging output to file. This is mostly used when the socket connection
closes with a batch file still being active.
\item[SCWriteUUencoded] sends iData in UU encoded form. For
communication with status clients.
\item[SCWriteZipped] writes pData in zipped form. Works only if the
connection is a plain connection, no telnet mode. This first sends a
line: SICSBIN ZIP dataname datalength followed by datalength bytes of
zipped data after the newline. Used for transferring larger amounts of
data to status clients.
\item[SCGetWriteFunc] gets the currently active write function.
\item[SCSetWriteFunc] sets a new write function.
\item[SCOnlySockWrite] write only to socket, not to log files.
\item[SCNotWrite] do not write at all.
\item[SCRegister] registers a callback with the connection. Parameters are: \item[SCRegister] registers a callback with the connection. Parameters are:
The interpreter to use, the interface with which the callback was The interpreter to use, the interface with which the callback was
registered and the ID of the callback. All automatic notifications to a registered and the ID of the callback. All automatic notifications to a
@ -304,11 +337,11 @@ happen.
\item[SCSetInterrupt] sets an interrupt on the connection. \item[SCSetInterrupt] sets an interrupt on the connection.
\item[SCGetInterrupt] retrives the current interrupt status of the \item[SCGetInterrupt] retrives the current interrupt status of the
connection. connection.
\item[SCSetError] sets an error code in the connection.
\item[SCGetError] retreives the current error code on the connection.
\item[SCinMacro] returns true if the connection is executing a tcl script, \item[SCinMacro] returns true if the connection is executing a tcl script,
returns false otherwise. returns false otherwise.
\item[SCsetMacro] sets the iMacro flag. \item[SCsetMacro] sets the iMacro flag.
\item[SCparChange] sets the flag that a parameter was changed and the
status file needs to be rewritten.
\item[SCGetRights] returns the current user rights associated with the \item[SCGetRights] returns the current user rights associated with the
connection. connection.
\item[SCGetGrab] gets the status of the control token for this connection. \item[SCGetGrab] gets the status of the control token for this connection.
@ -319,6 +352,8 @@ connection has the control token.
rights of the connection, 0 (false) otherwise. SCMatchRights also checks for rights of the connection, 0 (false) otherwise. SCMatchRights also checks for
the status of the control token. Suitable error messages are written to pCon the status of the control token. Suitable error messages are written to pCon
if the user rights do not match. if the user rights do not match.
\item[SCSetSimMode] sets this connection into simulation mode.
\item[SCinSimMode] checks for the simulation mode flag.
\item[SCInvoke] invokes pCommand in the SICS interpreter pSics for the \item[SCInvoke] invokes pCommand in the SICS interpreter pSics for the
connection pCon. This function also prints the executed command into connection pCon. This function also prints the executed command into
logfiles and into the commandlog. logfiles and into the commandlog.
@ -336,6 +371,8 @@ logfiles and into the commandlog.
Mark Koennecke, September 1997 Mark Koennecke, September 1997
Mark Koennecke, Aprl 2003
copyright: see copyright.h copyright: see copyright.h
----------------------------------------------------------------------------*/ ----------------------------------------------------------------------------*/
#ifndef SICSCONNECT #ifndef SICSCONNECT

View File

@ -19,6 +19,7 @@ $\langle$servdat {\footnotesize ?}$\rangle\equiv$
\mbox{}\verb@ mkChannel *pServerPort;@\\ \mbox{}\verb@ mkChannel *pServerPort;@\\
\mbox{}\verb@ pNetRead pReader;@\\ \mbox{}\verb@ pNetRead pReader;@\\
\mbox{}\verb@ int simMode;@\\ \mbox{}\verb@ int simMode;@\\
\mbox{}\verb@ SConnection *dummyCon;@\\
\mbox{}\verb@ } SicsServer;@\\ \mbox{}\verb@ } SicsServer;@\\
\mbox{}\verb@@$\diamond$ \mbox{}\verb@@$\diamond$
\end{list} \end{list}
@ -43,6 +44,8 @@ the SICS server is listening for connections.
communication object. communication object.
\item[simMode] a flag which is true when the SICS server is a simulation \item[simMode] a flag which is true when the SICS server is a simulation
server. server.
\item[dummyCon] A dummy connection to use when no other connection is
available for some reason.
\end{description} \end{description}

View File

@ -14,6 +14,7 @@ the system:
mkChannel *pServerPort; mkChannel *pServerPort;
pNetRead pReader; pNetRead pReader;
int simMode; int simMode;
SConnection *dummyCon;
} SicsServer; } SicsServer;
@} @}
@ -31,6 +32,8 @@ the SICS server is listening for connections.
communication object. communication object.
\item[simMode] a flag which is true when the SICS server is a simulation \item[simMode] a flag which is true when the SICS server is a simulation
server. server.
\item[dummyCon] A dummy connection to use when no other connection is
available for some reason.
\end{description} \end{description}

View File

@ -46,7 +46,7 @@ Just one function is exported:
\mbox{}\verb@#ifndef SERIALSICSWAIT@\\ \mbox{}\verb@#ifndef SERIALSICSWAIT@\\
\mbox{}\verb@#define SERIALSICSWAIT@\\ \mbox{}\verb@#define SERIALSICSWAIT@\\
\mbox{}\verb@#include "sics.h"@\\ \mbox{}\verb@#include "sics.h"@\\
\mbox{}\verb@#include "hardsup/serialsinq.h"@\\ \mbox{}\verb@#include "psi/hardsup/serialsinq.h"@\\
\mbox{}\verb@ int SerialSicsExecute(void **pData, char *pCommand, char *pReply, @\\ \mbox{}\verb@ int SerialSicsExecute(void **pData, char *pCommand, char *pReply, @\\
\mbox{}\verb@ int iBufLen);@\\ \mbox{}\verb@ int iBufLen);@\\
\mbox{}\verb@@\\ \mbox{}\verb@@\\

View File

@ -41,7 +41,7 @@ Just one function is exported:
#ifndef SERIALSICSWAIT #ifndef SERIALSICSWAIT
#define SERIALSICSWAIT #define SERIALSICSWAIT
#include "sics.h" #include "sics.h"
#include "hardsup/serialsinq.h" #include "psi/hardsup/serialsinq.h"
int SerialSicsExecute(void **pData, char *pCommand, char *pReply, int SerialSicsExecute(void **pData, char *pCommand, char *pReply,
int iBufLen); int iBufLen);