void QA::initResumeSession(void) { // this method may be used for two different purposes. First, // resuming within the same experiment. Second, continuation // from a parent experiment. // At first, a check over the ensemble of variables. // Get the name of the variable(s) used before // (only those with a trailing '_ave'). std::vector<std::string> vss( nc->getVarName() ) ; std::vector<std::string> prevTargets ; size_t pos; for( size_t i=0 ; i < vss.size() ; ++i ) if( (pos = vss[i].find("_ave")) < std::string::npos ) prevTargets.push_back( vss[i].substr(0, pos) ); // experiment specific qaExp.initResumeSession(prevTargets); // time specific qaTime.timeOutputBuffer.setNextFlushBeg(currQARec); qaTime.setNextFlushBeg(currQARec); if( qaTime.isTime && isCheckTime ) qaTime.initResumeSession(); // variables data statistics etc. for( size_t m=0 ; m < qaExp.varMeDa.size() ; ++m ) qaExp.varMeDa[m].qaData.initResumeSession(qaExp.varMeDa[m].var->name); return; }
HRESULT CopyFileFromSnapshot(const wchar_t* sourcePath, const wchar_t* destinationPath) { wchar_t expandedSourcePath[MAX_PATH]; wchar_t expandedDestinationPath[MAX_PATH]; try { if (0 == ::ExpandEnvironmentStrings(sourcePath, expandedSourcePath, MAX_PATH)) { throw CAtlException(GetLastError()); } if (0 == ::ExpandEnvironmentStrings(destinationPath, expandedDestinationPath, MAX_PATH)) { throw CAtlException(GetLastError()); } VssCopy vss(expandedSourcePath, expandedDestinationPath); vss.Init(); vss.CopyFileFromSnapshot(); } catch (CAtlException& e) { return static_cast<HRESULT>(e); } return S_OK; }
void Properties::serializeValueOut( QVariant value, QXmlStreamWriter& stream ) { if ( value.isValid( ) ) { stream.writeAttribute( "t", QString::number( value.type( ) ) ); QString vs; switch ( value.type( ) ) { case QVariant::Type::SizeF: { QSizeF s = value.toSizeF( ); QTextStream vss( &vs ); vss << s.width( ) << " x " << s.height( ); break; } default: vs = value.toString( ); } stream.writeAttribute( "v", vs ); } }