updated to reflect resource table API changes
This commit is contained in:
@@ -45,34 +45,22 @@ pvInfo exServer::billy (2.0, "billy", 10.0f, -10.0f, excasIoAsync, 1u);
|
||||
// exServer::exServer()
|
||||
//
|
||||
exServer::exServer(const char * const pvPrefix, unsigned aliasCount, aitBool scanOnIn) :
|
||||
caServer(NELEMENTS(this->pvList)+2u),
|
||||
simultAsychIOCount(0u),
|
||||
scanOn(scanOnIn)
|
||||
caServer (NELEMENTS(this->pvList)+2u),
|
||||
stringResTbl (NELEMENTS(this->pvList)*(aliasCount+1u)+2u),
|
||||
simultAsychIOCount (0u),
|
||||
scanOn (scanOnIn)
|
||||
{
|
||||
unsigned i;
|
||||
exPV *pPV;
|
||||
pvInfo *pPVI;
|
||||
pvInfo *pPVAfter =
|
||||
&exServer::pvList[NELEMENTS(exServer::pvList)];
|
||||
int resLibStatus;
|
||||
char pvAlias[256];
|
||||
const char * const pNameFmtStr = "%.100s%.20s";
|
||||
const char * const pAliasFmtStr = "%.100s%.20s%u";
|
||||
|
||||
exPV::initFT();
|
||||
|
||||
//
|
||||
// hash table size may need adjustment here?
|
||||
//
|
||||
resLibStatus = this->stringResTbl.init(NELEMENTS(this->pvList)*(aliasCount+1u)+2u);
|
||||
if (resLibStatus) {
|
||||
fprintf(stderr, "CAS: string resource id table init failed\n");
|
||||
//
|
||||
// should throw an exception once this is portable
|
||||
//
|
||||
assert(resLibStatus==0);
|
||||
}
|
||||
|
||||
//
|
||||
// pre-create all of the simple PVs that this server will export
|
||||
//
|
||||
|
||||
@@ -139,8 +139,8 @@ public:
|
||||
osiTimer(delayIn), pv(pvIn) {}
|
||||
~exScanTimer();
|
||||
void expire ();
|
||||
osiBool again() const;
|
||||
const osiTime delay() const;
|
||||
bool again() const;
|
||||
double delay() const;
|
||||
const char *name() const;
|
||||
private:
|
||||
exPV &pv;
|
||||
@@ -200,7 +200,7 @@ public:
|
||||
// If no one is watching scan the PV with 10.0
|
||||
// times the specified period
|
||||
//
|
||||
const float getScanPeriod()
|
||||
const double getScanPeriod()
|
||||
{
|
||||
double curPeriod;
|
||||
|
||||
@@ -208,7 +208,7 @@ public:
|
||||
if (!this->interest) {
|
||||
curPeriod *= 10.0L;
|
||||
}
|
||||
return (float) curPeriod;
|
||||
return curPeriod;
|
||||
}
|
||||
|
||||
caStatus read (const casCtx &, gdd &protoIn);
|
||||
@@ -255,10 +255,6 @@ private:
|
||||
//
|
||||
// Std PV Attribute fetch support
|
||||
//
|
||||
gddAppFuncTableStatus getStatus(gdd &value);
|
||||
gddAppFuncTableStatus getSeverity(gdd &value);
|
||||
gddAppFuncTableStatus getSeconds(gdd &value);
|
||||
gddAppFuncTableStatus getNanoseconds(gdd &value);
|
||||
gddAppFuncTableStatus getPrecision(gdd &value);
|
||||
gddAppFuncTableStatus getHighLimit(gdd &value);
|
||||
gddAppFuncTableStatus getLowLimit(gdd &value);
|
||||
@@ -410,7 +406,7 @@ private:
|
||||
//
|
||||
class exOSITimer : public osiTimer {
|
||||
public:
|
||||
exOSITimer (double delay) : osiTimer(osiTime(delay)) {}
|
||||
exOSITimer (double delay) : osiTimer(delay) {}
|
||||
|
||||
//
|
||||
// this is a noop that postpones the timer expiration
|
||||
|
||||
@@ -11,7 +11,7 @@ extern int main (int argc, const char **argv)
|
||||
osiTime begin(osiTime::getCurrent());
|
||||
exServer *pCAS;
|
||||
unsigned debugLevel = 0u;
|
||||
float executionTime;
|
||||
double executionTime;
|
||||
char pvPrefix[128] = "";
|
||||
unsigned aliasCount = 1u;
|
||||
unsigned scanOn = 1u;
|
||||
@@ -51,22 +51,20 @@ extern int main (int argc, const char **argv)
|
||||
pCAS->setDebugLevel(debugLevel);
|
||||
|
||||
if (forever) {
|
||||
osiTime delay(1000u,0u);
|
||||
//
|
||||
// loop here forever
|
||||
//
|
||||
while (aitTrue) {
|
||||
fileDescriptorManager.process(delay);
|
||||
fileDescriptorManager.process(1000.0);
|
||||
}
|
||||
}
|
||||
else {
|
||||
osiTime total(executionTime);
|
||||
osiTime delay(osiTime::getCurrent() - begin);
|
||||
double delay = osiTime::getCurrent() - begin;
|
||||
//
|
||||
// loop here untime the specified execution time
|
||||
// loop here untill the specified execution time
|
||||
// expires
|
||||
//
|
||||
while (delay < total) {
|
||||
while (delay < executionTime) {
|
||||
fileDescriptorManager.process(delay);
|
||||
delay = osiTime::getCurrent() - begin;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user