ProfileLoader::Profiles ProfileLoader::getAudioProfiles() const { Profiles profiles; for( Profiles::const_iterator it = _profiles.begin(); it != _profiles.end(); ++it ) { if( (*it).find( constants::avProfileType )->second == constants::avProfileTypeAudio ) profiles.push_back( *it ); } return profiles; }
void read_files(Model *m, const std::vector<std::string>& files, std::vector<std::string>& pdb_file_names, std::vector<std::string>& dat_files, std::vector<IMP::Particles>& particles_vec, Profiles& exp_profiles, bool residue_level, bool heavy_atoms_only, int multi_model_pdb, bool explicit_water, float max_q, int units) { for (unsigned int i = 0; i < files.size(); i++) { // check if file exists std::ifstream in_file(files[i].c_str()); if (!in_file) { IMP_WARN("Can't open file " << files[i] << std::endl); return; } // 1. try as pdb try { read_pdb(m, files[i], pdb_file_names, particles_vec, residue_level, heavy_atoms_only, multi_model_pdb, explicit_water); } catch (const IMP::ValueException &e) { // not a pdb file // 2. try as a dat profile file IMP_NEW(Profile, profile, (files[i], false, max_q, units)); if (profile->size() == 0) { IMP_WARN("can't parse input file " << files[i] << std::endl); return; } else { dat_files.push_back(files[i]); exp_profiles.push_back(profile); IMP_LOG_TERSE("Profile read from file " << files[i] << " size = " << profile->size() << std::endl); } } } }
void Memory::profilesToStringArray(String* s) { int i = 0; Profiles* iterator = profileContainerStart; while(iterator!=NULL) { s[i] = iterator->getName(); iterator = iterator->getNextProfile(); i++; } const static PROGMEM String backString("Back"); s[i] = backString; }
void COLAddrBook::GetProfiles(Profiles& profiles) { profiles.clear(); LPPROFADMIN pProfAdmin = NULL; if (SUCCEEDED(g_pMAPIEDK->pMAPIAdminProfiles(0, &pProfAdmin))) { LPMAPITABLE pProfTable = NULL; if (SUCCEEDED(pProfAdmin->GetProfileTable(0, &pProfTable))) { SizedSPropTagArray ( 2, sptCols ) = {2, PR_DISPLAY_NAME, PR_DEFAULT_PROFILE}; LPSRowSet pRowSet = NULL; if (SUCCEEDED(g_pMAPIEDK->pHrQueryAllRows(pProfTable, reinterpret_cast<SPropTagArray*>(&sptCols), NULL, NULL, 0, &pRowSet))) { for (ULONG i = 0; i < pRowSet->cRows; ++i) { bool bDefaultProfile = false; if (LPSPropValue pPVN = g_pMAPIEDK->pPpropFindProp(pRowSet->aRow[i].lpProps, pRowSet->aRow[i].cValues, PR_DEFAULT_PROFILE)) { bDefaultProfile = pPVN->Value.b != 0; } if (LPSPropValue pPVN = g_pMAPIEDK->pPpropFindProp(pRowSet->aRow[i].lpProps, pRowSet->aRow[i].cValues, PR_DISPLAY_NAME)) { profiles.push_back(std::make_pair(pPVN->Value.lpszA ? pPVN->Value.lpszA : "", bDefaultProfile)); } } g_pMAPIEDK->pFreeProws(pRowSet); } } if (pProfTable) pProfTable->Release(); } if (pProfAdmin) pProfAdmin->Release(); }
void COLAddrBook::ExtractChildFolders() { if (!m_initRef->Inited()) return; Profiles profiles; GetProfiles(profiles); if (1 == profiles.size()) { // профиль только один, его и будем открывать SessionLogOn(NULL, "", "", MAPI_NO_MAIL | MAPI_EXTENDED | MAPI_NEW_SESSION | MAPI_USE_DEFAULT); } else if (!profiles.empty()) { // профилей более одного, запрашиваем пользовател¤ SessionLogOn(NULL, "", "", MAPI_NO_MAIL | MAPI_EXTENDED | MAPI_NEW_SESSION | MAPI_LOGON_UI); } COLFolderBase::ExtractChildFolders(); }
void Memory::initProfileContainer() { profileContainerStart = new Profiles(NULL); PROFILE_CONTAINER_SIZE = EEPROM.read(MEMORY_SLOTS_BYTE); int i,j,k; Profiles* iterator = profileContainerStart; for(i=0;i<PROFILE_CONTAINER_SIZE;i++) { char tempProfileCharacterArray[9]; //profile names for(j=0;j<8;j++) { tempProfileCharacterArray[j] = (char)EEPROM.read(addressByteCounter++); } tempProfileCharacterArray[j]='\0'; String tempProfileName(tempProfileCharacterArray); iterator->setName(tempProfileName); //temperature iterator->setTemperature(EEPROM.read(addressByteCounter++)); //humidity iterator->setHumidity(EEPROM.read(addressByteCounter++)); iterator->setNextProfile(); iterator = iterator->getNextProfile(); } iterator->getPrevProfile()->setNextProfileToNULL(); }