restructured configuration
- removed RemovePsiCommands (the choice if a command is removed or not should be done when declaring it) - reduced the include list to the necessary files
This commit is contained in:
176
psi.c
176
psi.c
@ -3,32 +3,29 @@
|
|||||||
|
|
||||||
This is the site specific interface to SICS for PSI. This file implements
|
This is the site specific interface to SICS for PSI. This file implements
|
||||||
the interface defined in ../site.h
|
the interface defined in ../site.h
|
||||||
|
|
||||||
|
|
||||||
copyright: see file COPYRIGHT
|
copyright: see file COPYRIGHT
|
||||||
|
|
||||||
Mark Koennecke, June 2003 - May 2007
|
Mark Koennecke, June 2003 - May 2007
|
||||||
|
|
||||||
|
Modules initialized with an installation sics command are added to
|
||||||
|
AddPsiCommands with SCMD.
|
||||||
|
Modules initialized with a startup C command are added to SiteInit with
|
||||||
|
INIT.
|
||||||
|
There is no need to add include statements or prototype declarations for
|
||||||
|
above items.
|
||||||
|
However, for drivers added, we still need to declare the prototypes or
|
||||||
|
include the header file.
|
||||||
|
Markus Zolliker, Jan 2010
|
||||||
-----------------------------------------------------------------------*/
|
-----------------------------------------------------------------------*/
|
||||||
#include <stdlib.h>
|
|
||||||
#include <assert.h>
|
|
||||||
#include <fortify.h>
|
|
||||||
#include <sics.h>
|
|
||||||
#include <motor.h>
|
|
||||||
#include <tcl.h>
|
#include <tcl.h>
|
||||||
|
#include "site.h"
|
||||||
|
#include "sics.h"
|
||||||
|
#include <motor.h>
|
||||||
#include <site.h>
|
#include <site.h>
|
||||||
#include "buffer.h"
|
|
||||||
#include "sps.h"
|
|
||||||
#include "pimotor.h"
|
|
||||||
#include "sanswave.h"
|
|
||||||
#include "faverage.h"
|
|
||||||
#include "amorstat.h"
|
|
||||||
#include "tas.h"
|
|
||||||
#include "swmotor.h"
|
|
||||||
#include "polterwrite.h"
|
|
||||||
#include "ecb.h"
|
|
||||||
#include "frame.h"
|
|
||||||
#include "ecbdriv.h"
|
#include "ecbdriv.h"
|
||||||
#include "ecbcounter.h"
|
#include "ecbcounter.h"
|
||||||
#include <stringdict.h>
|
|
||||||
#include "sinqhmdriv.i"
|
#include "sinqhmdriv.i"
|
||||||
#include "tdchm.h"
|
#include "tdchm.h"
|
||||||
#include "tecsdriv.h"
|
#include "tecsdriv.h"
|
||||||
@ -40,41 +37,8 @@
|
|||||||
#include "el755driv.h"
|
#include "el755driv.h"
|
||||||
#include <evdriver.i>
|
#include <evdriver.i>
|
||||||
#include "serial.h"
|
#include "serial.h"
|
||||||
#include "fomerge.h"
|
|
||||||
#include "remob.h"
|
|
||||||
#include "tricssupport.h"
|
|
||||||
#include "sinq.h"
|
#include "sinq.h"
|
||||||
#include "tabledrive.h"
|
|
||||||
#include "amorset.h"
|
|
||||||
#include "sinqhttp.h"
|
#include "sinqhttp.h"
|
||||||
#include "poldizug.h"
|
|
||||||
#include "autowin.h"
|
|
||||||
/*
|
|
||||||
* from julcho.c
|
|
||||||
*/
|
|
||||||
extern int JulChoFactory(SConnection * pCon, SicsInterp * pSics,
|
|
||||||
void *pData, int argc, char *argv[]);
|
|
||||||
/* from ritastorage.c */
|
|
||||||
extern int MakeRitaFix(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|
||||||
int argc, char *argv[]);
|
|
||||||
/* from sanslirebin.c */
|
|
||||||
extern int MakeSansliRebin(SConnection * pCon, SicsInterp * pSics,
|
|
||||||
void *pData, int argc, char *argv[]);
|
|
||||||
/* from lmd200.c */
|
|
||||||
extern int MakeLMD200(SConnection * pCon, SicsInterp * pSics, void *pData,
|
|
||||||
int argc, char *argv[]);
|
|
||||||
/* from julchoprot.c */
|
|
||||||
extern void AddJulChoProtocoll();
|
|
||||||
/* from sinqhttpprot.c */
|
|
||||||
extern void AddHttpProtocoll();
|
|
||||||
/* from pmacprot.c */
|
|
||||||
extern void AddPMACProtocoll();
|
|
||||||
/* from pfeifferprot.c */
|
|
||||||
extern void AddPfeifferProtocoll();
|
|
||||||
/* from termprot.c */
|
|
||||||
extern void AddTermProtocoll();
|
|
||||||
/* from phytron.c */
|
|
||||||
extern void AddPhytronProtocoll();
|
|
||||||
|
|
||||||
/*--------------------------------------------------------------------------*/
|
/*--------------------------------------------------------------------------*/
|
||||||
void SiteInit(void)
|
void SiteInit(void)
|
||||||
@ -99,12 +63,12 @@ void SiteInit(void)
|
|||||||
/*
|
/*
|
||||||
* SICS specific Asynchronous I/O protocols
|
* SICS specific Asynchronous I/O protocols
|
||||||
*/
|
*/
|
||||||
AddJulChoProtocoll();
|
INIT(AddJulChoProtocoll);
|
||||||
AddHttpProtocoll();
|
INIT(AddHttpProtocoll);
|
||||||
AddPMACProtocoll();
|
INIT(AddPMACProtocoll);
|
||||||
AddPfeifferProtocoll();
|
INIT(AddPfeifferProtocoll);
|
||||||
AddTermProtocoll();
|
INIT(AddTermProtocoll);
|
||||||
AddPhytronProtocoll();
|
INIT(AddPhytronProtocoll);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -114,66 +78,48 @@ static pSite sitePSI = NULL;
|
|||||||
/*----------------------------------------------------------------------*/
|
/*----------------------------------------------------------------------*/
|
||||||
static void AddPsiCommands(SicsInterp * pInter)
|
static void AddPsiCommands(SicsInterp * pInter)
|
||||||
{
|
{
|
||||||
AddCommand(pInter, "MakeRuenBuffer", InitBufferSys, NULL, NULL);
|
/* declare and add permanent command */
|
||||||
AddCommand(pInter, "MakeTRICSSupport", MakeTricsSupport, NULL, NULL);
|
#define PCMD(NAME, FUN) { \
|
||||||
AddCommand(pInter, "MakeSPS", SPSFactory, NULL, NULL);
|
int FUN(SConnection * pCon, SicsInterp * pSics, void *pData, \
|
||||||
AddCommand(pInter, "MakePIMotor", PIMotorFactory, NULL, NULL);
|
int argc, char *argv[]); \
|
||||||
AddCommand(pInter, "MakeSANSWave", MakeSANSWave, NULL, NULL);
|
AddCommandWithFlag(pInter, NAME, FUN, NULL, NULL, 0); \
|
||||||
AddCommand(pInter, "MakeFocusAverager", MakeFA, NULL, NULL);
|
}
|
||||||
AddCommand(pInter, "MakeAmorStatus", AmorStatusFactory, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakeTAS", TASFactory, NULL, NULL);
|
/* declare and add startup command */
|
||||||
AddCommand(pInter, "MakeSWMotor", MakeSWMotor, NULL, NULL);
|
#define SCMD(NAME, FUN) { \
|
||||||
AddCommand(pInter, "MakeSWHPMotor", MakeSWHPMotor, NULL, NULL);
|
int FUN(SConnection * pCon, SicsInterp * pSics, void *pData, \
|
||||||
AddCommand(pInter, "PolterInstall", PolterInstall, NULL, NULL);
|
int argc, char *argv[]); \
|
||||||
AddCommand(pInter, "MakeECB", MakeECB, NULL, NULL);
|
AddCommandWithFlag(pInter, NAME, FUN, NULL, NULL, 1); \
|
||||||
AddCommand(pInter, "MakePSDFrame", MakeFrameFunc, NULL, NULL);
|
}
|
||||||
AddCommand(pInter, "SerialInit", SerialInit, NULL, NULL);
|
|
||||||
AddCommand(pInter, "InstallFocusMerge", InstallFocusMerge, NULL, NULL);
|
|
||||||
AddCommand(pInter, "Remob", RemobCreate, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakeSinq", SinqFactory, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakeTableDrive", TableDriveFactory, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakeAmorSet", AmorSetFactory, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakeJulCho", JulChoFactory, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakeRitaFix", MakeRitaFix, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakePoldiReiss", MakePoldiReiss, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakeSansliRebin", MakeSansliRebin, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakeLMD200", MakeLMD200, NULL, NULL);
|
|
||||||
AddCommand(pInter, "MakeRitaWin", MakeRitaWin, NULL, NULL);
|
|
||||||
/*
|
|
||||||
AddCommand(pInter,"MakeDifrac",MakeDifrac,NULL,NULL);
|
|
||||||
*/
|
|
||||||
}
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
/* alphabetic order */
|
||||||
static void RemovePsiCommands(SicsInterp * pSics)
|
SCMD("InstallFocusMerge", InstallFocusMerge);
|
||||||
{
|
SCMD("MakeAmorSet", AmorSetFactory);
|
||||||
RemoveCommand(pSics, "MakeTRICSSupport");
|
SCMD("MakeAmorStatus", AmorStatusFactory);
|
||||||
RemoveCommand(pSics, "MakeSPS");
|
SCMD("MakeECB", MakeECB);
|
||||||
RemoveCommand(pSics, "MakePIMotor");
|
SCMD("MakeFocusAverager", MakeFA);
|
||||||
RemoveCommand(pSics, "MakeSANSWave");
|
SCMD("MakeJulCho", JulChoFactory);
|
||||||
RemoveCommand(pSics, "MakeFocusAverager");
|
SCMD("MakeLMD200", MakeLMD200);
|
||||||
RemoveCommand(pSics, "FocusInstall");
|
SCMD("MakePIMotor", PIMotorFactory);
|
||||||
RemoveCommand(pSics, "InstallFocusMerge");
|
SCMD("MakePoldiReiss", MakePoldiReiss);
|
||||||
RemoveCommand(pSics, "MakeStoreAmor");
|
SCMD("MakePSDFrame", MakeFrameFunc);
|
||||||
RemoveCommand(pSics, "MakeAmorStatus");
|
SCMD("MakeRitaFix", MakeRitaFix);
|
||||||
RemoveCommand(pSics, "MakeJulCho");
|
SCMD("MakeRitaWin", MakeRitaWin);
|
||||||
RemoveCommand(pSics, "MakeRitaFix");
|
PCMD("MakeRuenBuffer", InitBufferSys);
|
||||||
RemoveCommand(pSics, "MakePoldiReiss");
|
SCMD("MakeSansliRebin", MakeSansliRebin);
|
||||||
RemoveCommand(pSics, "MakeSansliRebin");
|
SCMD("MakeSANSWave", MakeSANSWave);
|
||||||
RemoveCommand(pSics, "MakeLMD200");
|
SCMD("MakeSinq", SinqFactory);
|
||||||
|
SCMD("MakeSPS", SPSFactory);
|
||||||
|
PCMD("MakeSWHPMotor", MakeSWHPMotor);
|
||||||
|
SCMD("MakeSWMotor", MakeSWMotor);
|
||||||
|
SCMD("MakeTableDrive", TableDriveFactory);
|
||||||
|
SCMD("MakeTAS", TASFactory);
|
||||||
|
SCMD("MakeTRICSSupport", MakeTricsSupport);
|
||||||
|
SCMD("PolterInstall", PolterInstall);
|
||||||
|
SCMD("SerialInit", SerialInit);
|
||||||
/*
|
/*
|
||||||
RemoveCommand(pSics,"MakeDifrac");
|
SCMD("MakeDifrac",MakeDifrac);
|
||||||
*/
|
*/
|
||||||
RemoveCommand(pSics, "MakeTAS");
|
|
||||||
RemoveCommand(pSics, "MakeSWMotor");
|
|
||||||
RemoveCommand(pSics, "PolterInstall");
|
|
||||||
RemoveCommand(pSics, "MakeECB");
|
|
||||||
RemoveCommand(pSics, "MakePSDFrame");
|
|
||||||
RemoveCommand(pSics, "SerialInit");
|
|
||||||
RemoveCommand(pSics, "MakeSinq");
|
|
||||||
RemoveCommand(pSics, "MakeTableDrive");
|
|
||||||
RemoveCommand(pSics, "MakeAmorSet");
|
|
||||||
RemoveCommand(pSics, "MakeRitaWin");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*---------------------------------------------------------------------*/
|
/*---------------------------------------------------------------------*/
|
||||||
@ -599,7 +545,7 @@ pSite getSite(void)
|
|||||||
initializing function pointers
|
initializing function pointers
|
||||||
*/
|
*/
|
||||||
sitePSI->AddSiteCommands = AddPsiCommands;
|
sitePSI->AddSiteCommands = AddPsiCommands;
|
||||||
sitePSI->RemoveSiteCommands = RemovePsiCommands;
|
sitePSI->RemoveSiteCommands = NULL;
|
||||||
sitePSI->CreateMotor = CreatePsiMotor;
|
sitePSI->CreateMotor = CreatePsiMotor;
|
||||||
sitePSI->CreateCounterDriver = CreatePsiCounterDriver;
|
sitePSI->CreateCounterDriver = CreatePsiCounterDriver;
|
||||||
sitePSI->CreateHistogramMemoryDriver = CreatePsiHistMem;
|
sitePSI->CreateHistogramMemoryDriver = CreatePsiHistMem;
|
||||||
|
Reference in New Issue
Block a user