added new files

This commit is contained in:
Jeff Hill
1996-09-04 20:10:43 +00:00
parent 6b3a62de9f
commit dd43f91278
3 changed files with 142 additions and 0 deletions

View File

@@ -0,0 +1,38 @@
CAS = ../../
TOP = $(CAS)/../..
include $(TOP)/config/CONFIG_BASE
CXXCMPLR = STRICT
USR_INCLUDES =
USR_LDFLAGS =
DEPLIBS_BASE = $(EPICS_BASE_LIB)
DEPLIBS = $(DEPLIBS_BASE)/libcas.a $(DEPLIBSWOCAS)
SRCS.cc += ../vxEntry.cc
SRCS.cc += ../exServer.cc
SRCS.cc += ../exPV.cc
SRCS.cc += ../exSyncPV.cc
SRCS.cc += ../exAsyncPV.cc
SRCS.cc += ../exChannel.cc
LIBOBJS += vxEntry.o
LIBOBJS += exServer.o
LIBOBJS += exPV.o
LIBOBJS += exSyncPV.o
LIBOBJS += exAsyncPV.o
LIBOBJS += exChannel.o
LIBNAME = libexserver.o
include $(TOP)/config/RULES.Vx
excas: $(OBJS) $(DEPLIBS)
$(LINK.cc) -o $@ $(OBJS) $(LDFLAGS) $(LDLIBS)
clean::
@$(RM) -rf Templates.DB
@$(RM) core

61
src/cas/example/main.cc Normal file
View File

@@ -0,0 +1,61 @@
#include <exServer.h>
#include <fdManager.h>
//
// main()
//
int main (int argc, const char **argv)
{
osiTime begin(osiTime::getCurrent());
exServer *pCAS;
unsigned debugLevel = 0u;
float executionTime;
aitBool forever = aitTrue;
int i;
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
for (i=1; i<argc; i++) {
if (sscanf(argv[i], "-d %u", &debugLevel)==1) {
continue;
}
if (sscanf(argv[i],"-t %f", &executionTime)==1) {
forever = aitFalse;
continue;
}
printf ("usage: %s -d<debug level> -t<execution time>\n",
argv[0]);
return (1);
}
pCAS->setDebugLevel(debugLevel);
if (forever) {
osiTime delay(1000u,0u);
//
// loop here forever
//
while (aitTrue) {
fileDescriptorManager.process(delay);
}
}
else {
osiTime total(executionTime);
osiTime delay(osiTime::getCurrent() - begin);
//
// loop here untime the specified execution time
// expires
//
while (delay < total) {
fileDescriptorManager.process(delay);
delay = osiTime::getCurrent() - begin;
}
}
delete pCAS;
return (0);
}

View File

@@ -0,0 +1,43 @@
#include <exServer.h>
#include <taskLib.h>
//
// main()
//
int excas (unsigned debugLevel=0u, unsigned delaySec=0)
{
osiTime begin(osiTime::getCurrent());
exServer *pCAS;
pCAS = new exServer(32u,5u,500u);
if (!pCAS) {
return (-1);
}
pCAS->setDebugLevel(debugLevel);
if (delaySec==0u) {
//
// loop here forever
//
while (aitTrue) {
taskDelay(10);
}
}
else {
osiTime total( ((float)delaySec) );
osiTime delay(osiTime::getCurrent() - begin);
//
// loop here untill the specified execution time
// expires
//
while (delay < total) {
taskDelay(10);
delay = osiTime::getCurrent() - begin;
}
}
delete pCAS;
return (0);
}