return err;
}
BError Control::test(BList<BError>& errors){
BError errRet;
BError err;
BIter i;
dprintf(DBG_CMD, "%s\n", __PRETTY_FUNCTION__);
opupeEnginesLock.rdLock();
for(opupeEngines.start(i); !opupeEngines.isEnd(i); opupeEngines.next(i)){
if(err = opupeEngines[i]->status()){
errors.append(BError(err.getErrorNo(), getName() + "Pupe" + opupeEngines[i]->getSlot() + ": Status: " + err.getErrorNo() + " " + err.getString()));
}
else {
errors.append(BError(0, getName() + "Pupe" + opupeEngines[i]->getSlot() + ": Status: " + "Ok"));
}
}
opupeEnginesLock.unlock();
return errRet;
}
BError Control::getStatus(BList<NameValue>& statusList){
BError err;
BError e;
int numPupe = 0;
BIter i;
BString s;
int p;
BList<NameValue> l;
dprintf(DBG_CMD, "%s\n", __PRETTY_FUNCTION__);
opupeEnginesLock.rdLock();
#ifdef ZAP
for(opupeEngines.start(i), p = 1; !opupeEngines.isEnd(i); opupeEngines.next(i), p++){
e = opupeEngines[i]->status();
s = BString(e.getErrorNo()) + ",\"" + e.getString() + "\"";
statusList.append(NameValue(BString("TmsPuServer") + onum + "_Pupe" + p + "_Error", s));
if(!e){
numPupe++;
}
}
#else
for(opupeEngines.start(i), p = 1; !opupeEngines.isEnd(i); opupeEngines.next(i), p++){
e = opupeEngines[i]->status();
if(!e){
numPupe++;
}
opupeEngines[i]->getStatusList(PuChannel(1,1,1), statusList);
// statusList = statusList + l;
}
#endif
opupeEnginesLock.unlock();
olock.lock();
statusList.append(NameValue(BString("Module") + moduleNum() + "_Running", "1"));
statusList.append(NameValue(BString("Module") + moduleNum() + "_NumberPupe", numPupe));
statusList.append(NameValue(BString("Module") + moduleNum() + "_CycleNumber", ocycleNumber));
statusList.append(NameValue(BString("Module") + moduleNum() + "_CycleType", ocycleType));
olock.unlock();
return err;
}
BError Control::getStatistics(BList<NameValue>& statsList){
BError err;
dprintf(DBG_CMD, "%s\n", __PRETTY_FUNCTION__);
statsList.append(NameValue(BString("Module") + moduleNum() + "_UpTime", getTime() - ostartTime));
statsList.append(NameValue(BString("Module") + moduleNum() + "_CycleNumProcessed", ocycleProcessed));
return err;
}
BError Control::getMasterPuChannel(PuChannel& puChannel){
BError err;
dprintf(DBG_CMD, "%s\n", __PRETTY_FUNCTION__);
puChannel.moduleNum = onum;
puChannel.pupeNum = omaster + 1;
puChannel.pupeChan = 1;
return err;
}
BError Control::addEventServer(BString name){
BError err;
dprintf(DBG_CMD, "%s: %s\n", __PRETTY_FUNCTION__, name.retStr());
oeventServers.append(name);
return err;
}
BError Control::delEventServer(BString name){
BError err;
BIter i;
dprintf(DBG_CMD, "%s\n", __PRETTY_FUNCTION__);
oeventServers.del(name);
return err;
}
BError Control::setControlInfo(CycleParam params){
BError err;
BIter i;
BIter i1, i2;
int found = 0;