示例#1
0
文件: CKitList.cpp 项目: ncbi/osiris
bool CPersistKitList::Load()
{
  wxString sFile;
  CIncrementer x(m_nInLoad);
  const CILSLadderInfo *pLdr = GetILSLadderInfo();
  const std::vector<CILSkit *> *pvKits = pLdr->GetKits();
  std::vector<CILSkit *>::const_iterator itr;
  CILSkit *pKit;
  int nCount = 0;
  m_bV1 = false;
  Clear();

  // load all kit xml files

  for(itr = pvKits->begin();
      itr != pvKits->end();
      ++itr)
  {
    pKit = *itr;
    m_sLastKit = pKit->GetKitName();
    m_pLastKitLocus = NULL;
    m_pLastKitLS = NULL;
    m_pLastKitChannelMap = NULL;
    LSitr itrLS = m_mLS.find(m_sLastKit);
    m_pLastKitLS = 
      (itrLS == m_mLS.end())
      ? NULL
      : itrLS->second;
    itrLS = m_mILS.find(m_sLastKit);
    m_pLastKit_ILS = 
      (itrLS == m_mILS.end())
      ? NULL
      : itrLS->second;

    KLNCitr itrLocus = m_mapKitLocus.find(m_sLastKit);
    m_pLastKitLocus =
      (itrLocus == m_mapKitLocus.end())
      ? NULL
      : itrLocus->second;

    sFile = pKit->GetFilePath();
    if(LoadFile(sFile))
    {
      Add(m_sLastKit);
      nCount++;
    }
    else
    {
      _AddError();
    }
  }
  nwxString::Trim(&m_sErrorMsg);
  _HACK_27(pLdr);
  SortILS();
  return (nCount > 0);
}
bool CPersistKitList::Load()
{
  wxString sFile;
  CILSLadderInfo ldr(true);
  CIncrementer x(m_nInLoad);
  if(!ldr.IsOK())
  {
    _SetLoadError();
  }
  vector<CILSkit *> *pvKits = ldr.GetKits();
  vector<CILSkit *>::iterator itr;
  CILSkit *pKit;
  int nCount = 0;
  m_bV1 = false;
  Clear();

  // load all kit xml files

  for(itr = pvKits->begin();
      itr != pvKits->end();
      ++itr)
  {
    pKit = *itr;
    m_sLastKit = pKit->GetKitName();
    m_pLastKitLocus = NULL;
    m_pLastKitLS = NULL;
    LSitr itrLS = m_mLS.find(m_sLastKit);
    m_pLastKitLS = 
      (itrLS == m_mLS.end())
      ? NULL
      : itrLS->second;
    KLNCitr itrLocus = m_mapKitLocus.find(m_sLastKit);
    m_pLastKitLocus =
      (itrLocus == m_mapKitLocus.end())
      ? NULL
      : itrLocus->second;

    sFile = pKit->GetFilePath();
    if(LoadFile(sFile))
    {
      Add(m_sLastKit);
      nCount++;
    }
    else
    {
      _AddError();
    }
  }
  nwxString::Trim(&m_sErrorMsg);
  SortILS();
  return (nCount > 0);
}