Overview | Releases | Download | Docs | Links | Help | RecentChanges

ISPublishProblems

SctApi/SctApiRaw?.cxx publishes things using code like:

  const boost::shared_ptr<Trigger> trigger = scan->getTrigger1();
 #if USE_IS
  if(m_isDict) {
    ISInfoInt binNumber(0);
    m_isDict->insert("SCTAPIServer.currentBin", binNumber);
    ISInfoInt maxNumber(scanPoints.size()-1);
    m_isDict->insert("SCTAPIServer.maxBin", maxNumber);
  }
 #endif

whereas the CC publishes its STATUS via CalibrationController/src/CalibrationControllerImpl?.cpp's

 void CalibrationControllerImpl::updateStatus() {
  Sct::BugReport("BUG01","CCImpl.cpp","In updateStatus 1/4");
  string name = SctNames::getControlDataName();
  Sct::BugReport("BUG01","CCImpl.cpp","In updateStatus 2/4");
  name += ".Status";
  Sct::BugReport("BUG01","CCImpl.cpp","In updateStatus 3/4");
  ISUtilities::addOrUpdateOrMessage(name, status, __FILE__, __LINE__, MRS_DIAGNOSTIC);
  Sct::BugReport("BUG01","CCImpl.cpp","In updateStatus 4/4");
 }

which uses SCT/src/ISUtilities.cpp's

 void ISUtilities::addOrUpdateOrThrow(std::string& name, ISInfo& info, const std::string& file, int line, severity sev){
  ISInfoDictionary& is = SctNames::getISDictionary();
  ISInfo::Status st=is.contains(name);
  if ( st==ISInfo::Success ) {
    st = is.update(name, info);
  } else if ( st==ISInfo::NotFound ) {
    st = is.insert(name, info);
  }
  if (st != ISInfo::Success) {
    throw IsException(st, "CalibrationControllerImpl can't update status", file, line);
  }
 } 

and

 void ISUtilities::addOrUpdateOrMessage(std::string& name, ISInfo& info, const std::string& file, int line, severity sev){
  try {
    addOrUpdateOrThrow(name, info, file, line, sev);
  }catch(Throwable& e){
    e.sendToMrs(sev);
  }
 }

which relies on the CalibrationControllerImpl?'s "status" object being a CalibrationController/src/IS/CalibrationControllerStatus?.h which derives

 class CalibrationControllerStatus: public ISInfo

and thus has to implement a

    void publishGuts( ISostream & out ){
        out << (int)status << updateOption << currentSequence << currentTest << currentScanIndex;
    }

method which the ISUtilities use to guarantee that they can pass it to is.insert