Esempio n. 1
0
bool
fsio::load_mscalibfile( adfs::filesystem& fs, adcontrols::MSCalibrateResult& d )
{
    return load( fs, d, d.dataClass(), L"/MSCalibration" );
}
Esempio n. 2
0
bool
rawdata::applyCalibration( const std::wstring& dataInterpreterClsid, const adcontrols::MSCalibrateResult& calibResult )
{
#if 0
    boost::uuids::uuid objid;
    
    auto it = std::find_if( conf_.begin(), conf_.end(), [=](const adutils::AcquiredConf::data& c){
            return c.dataInterpreterClsid == dataInterpreterClsid;
        });

    if ( it != conf_.end() )
        objid = it->objid;
    else {
        if ( conf_.empty() ) 
            adutils::v3::AcquiredConf::create_table_v3( dbf_.db() );
        adutils::v3::AcquiredConf::data d;
		d.objid = objid;
        d.dataInterpreterClsid.resize( dataInterpreterClsid.size() );
        std::copy( dataInterpreterClsid.begin(), dataInterpreterClsid.end(), d.dataInterpreterClsid.begin() );
        if ( !adutils::v3::AcquiredConf::insert( dbf_.db(), objid, d ) )
            return false;
    }

	const std::wstring calibId = calibResult.calibration().calibId();
    std::string device;
    if ( adportable::binary::serialize<>()(calibResult, device) ) {
        adutils::mscalibio::writeCalibration( dbf_.db(), uint32_t( objid ), calibId.c_str(), calibResult.dataClass(), device.data(), device.size() );
        loadAcquiredConf();
        loadCalibrations();
        return true;
    }
#endif
    return false;
}
Esempio n. 3
0
bool
fsio::save_mscalibfile( adfs::filesystem& fs, const adcontrols::MSCalibrateResult& d )
{
    return save( fs, d, d.dataClass(), L"/MSCalibration" );
}