PSI sics-cvs-psi-2006
This commit is contained in:
121
scanvar.h
Normal file
121
scanvar.h
Normal file
@@ -0,0 +1,121 @@
|
||||
|
||||
/*-----------------------------------------------------------------------
|
||||
Header file for the SICS ScanVariable. This is a support module for
|
||||
the SICS scan system.
|
||||
|
||||
Evolved during refactoring scan in November 2004
|
||||
|
||||
copyright: see file COPYRIGHT
|
||||
|
||||
Mark Koennecke, November 2004
|
||||
-------------------------------------------------------------------------*/
|
||||
#ifndef SICSSCANVAR
|
||||
#define SICSSCANVAR
|
||||
#include "sics.h"
|
||||
|
||||
typedef struct {
|
||||
char Name[132];
|
||||
pIDrivable pInter;
|
||||
pDummy pObject;
|
||||
float fStart;
|
||||
float fStep;
|
||||
float *fData;
|
||||
int dataList;
|
||||
int logVar;
|
||||
}VarEntry, *pVarEntry;
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
|
||||
/**
|
||||
* MakeScanVar creates a scan variable. All the necessary checks are
|
||||
* performed
|
||||
* @param pSics The interpreter in order to locate the variable.
|
||||
* @param pCon A connection object for error reporting
|
||||
* @param name The name of the variable to scan
|
||||
* @param start The start position from which to scan
|
||||
* @param step The step width with which to scan.
|
||||
* @return A pointer to a new scan variable object on success, NULL
|
||||
* else NULL
|
||||
*/
|
||||
pVarEntry MakeScanVar(SicsInterp *pSics, SConnection *pCon, char
|
||||
*name, float start, float step);
|
||||
/*
|
||||
* Make a variable which is logged during the scan
|
||||
* @param pSics The SICS interpreter to search for the variable
|
||||
* @param pCon A connection to report problems to
|
||||
* @param name The name of the variable to log
|
||||
* @return A pointer to a new scan variable object on success, NULL
|
||||
* else NULL
|
||||
*/
|
||||
pVarEntry MakeLogVar(SicsInterp *pSics, SConnection *pCon, char *name);
|
||||
/**
|
||||
* InitScanVar clears the list of scan points
|
||||
* @param pvar The scan variable to clear
|
||||
*/
|
||||
void InitScanVar(pVarEntry pVar);
|
||||
/**
|
||||
* DeleteVarEntry deletes a scan variable.
|
||||
* @param pData The scan variable entry to delete.
|
||||
*/
|
||||
void DeleteVarEntry(void *pData);
|
||||
/**
|
||||
* ScanVarName returns the name of the scan variable
|
||||
* @param pVar The scan variable to query.
|
||||
* @return The name of the scan variable. Do not delete pointer.
|
||||
*/
|
||||
char *ScanVarName(pVarEntry pVar);
|
||||
/**
|
||||
* ScanVarStart returns the start value for the scan
|
||||
* @param pVar The scan variable to query.
|
||||
* @return The start point for the scan.
|
||||
*/
|
||||
float ScanVarStart(pVarEntry pVar);
|
||||
/**
|
||||
* ScanVarStep returns the start value for the scan
|
||||
* @param pVar The scan variable to query.
|
||||
* @return The step width for the scan.
|
||||
*/
|
||||
float ScanVarStep(pVarEntry pVar);
|
||||
/**
|
||||
* check if the scan is possible, i.e the scan variable does
|
||||
* not violate the limits in the scan
|
||||
* @param pVar The scan variable to check
|
||||
* @param pCon The connection to report errors to
|
||||
* @return 1 when OK, 0 when the limits are violated.
|
||||
*/
|
||||
int CheckScanVar(pVarEntry pVar, SConnection *pCon, int np);
|
||||
/**
|
||||
* StartScanVar starts the scan variable to drive to the next
|
||||
* position.
|
||||
* @param pVar The scan variable to start.
|
||||
* @param pCon The connection to report errors to.
|
||||
* @param i The position number to drive to
|
||||
* @return 1 on success, 0 on failure
|
||||
*/
|
||||
int StartScanVar(pVarEntry pVar, SConnection *pCon, int i);
|
||||
/**
|
||||
* AppendScanVar appends a position to the list of positions
|
||||
* reached while scanning this variable.
|
||||
* @param pVar The scan variable to append to.
|
||||
* @param pos The position to append.
|
||||
*/
|
||||
void AppendScanVar(pVarEntry pVar, float pos);
|
||||
/**
|
||||
* GetScanVarPos returns a position for an index.
|
||||
* @param pVar The scan variable to append to.
|
||||
* @param i The position number to retrieve
|
||||
* @return The positiopn or -99999.99 for an error
|
||||
*/
|
||||
float GetScanVarPos(pVarEntry pVar, int i);
|
||||
/**
|
||||
* CopyScanVar copies the scan positions to the array given.
|
||||
* @param pVar The scan variable to copy from
|
||||
* @param fData The array to copy to.
|
||||
* @param np The number of slots in fData.
|
||||
*/
|
||||
void CopyScanVar(pVarEntry pVar, float *fData, int np);
|
||||
/**
|
||||
* enquires if a variable is a logged variable or a proper scan variable
|
||||
*/
|
||||
int isLogVar(pVarEntry pVar);
|
||||
#endif
|
||||
Reference in New Issue
Block a user