示例#1
0
// =============================================================================
void LogBuffer::Load( PvConfigurationReader &aReader )
{
    PvResult lResult;
    PvString lPvStr;

	// Always load from a blank setup!
	ResetConfig();

	// bool mGenICamEnabled;
    lResult = aReader.Restore( TAG_GENICAMENABLED, lPvStr );
    if ( lResult.IsOK() )
    {
        mGenICamEnabled = ( lPvStr == VAL_TRUE );
    }

	// bool mBufferAllEnabled;
    lResult = aReader.Restore( TAG_BUFFERALLENABLED, lPvStr );
    if ( lResult.IsOK() )
    {
        mBufferAllEnabled = ( lPvStr == VAL_TRUE );
    }

	// bool mBufferErrorEnabled;
    lResult = aReader.Restore( TAG_BUFFERERRORENABLED, lPvStr );
    if ( lResult.IsOK() )
    {
        mBufferErrorEnabled = ( lPvStr == VAL_TRUE );
    }

	// QString mFilename;
    lResult = aReader.Restore( TAG_LOGFILENAME, lPvStr );
    if ( lResult.IsOK() )
	{
		SetFilename( lPvStr.GetAscii() );
	}

	// bool mWriteToFileEnabled;
    lResult = aReader.Restore( TAG_WRITETOFILEENABLED, lPvStr );
    if ( lResult.IsOK() )
    {
        SetWriteToFileEnabled( lPvStr == VAL_TRUE );
    }
}
void ImageSaveDlg::Load( PvConfigurationReader &aReader )
{
    PvString lSaveEnabled;
    PvString lSaveEnabledTag("saveenabled");
    aReader.Restore(lSaveEnabledTag, lSaveEnabled);
    if (strcmp(lSaveEnabled.GetAscii(),"1") == 0 )
    {
        mSaveEnabled = true;
    }
    else
    {
        mSaveEnabled = false;
    }

    PvString lOneOutOf;
    aReader.Restore( "oneoutof", lOneOutOf );
    mOneOutOf = atoi( lOneOutOf.GetAscii() );

    PvString lMaxRate;
    aReader.Restore( "maxrate", lMaxRate );
    mMaxRate = atoi( lMaxRate.GetAscii() );

    PvString lAverageThroughput;
    aReader.Restore( "averagethroughput", lAverageThroughput );
    mAverageThroughput = atoi(lAverageThroughput.GetAscii());

    PvString lSaveThrottleOption;
    aReader.Restore( "savethrottleoption", lSaveThrottleOption );
    mSaveThrottling = (SaveThrottleOption)atoi( lSaveThrottleOption.GetAscii() );

    PvString lSavePath;
    aReader.Restore( "savepath", lSavePath );
    mSavePath = lSavePath.GetAscii();

    PvString lFormat;
    aReader.Restore( "saveformat", lFormat );
    QString lStr( lFormat.GetAscii() );
    QString lLower = lStr.toLower();
    if ( lLower == "bmp" )
    {
        mFormat = FORMAT_BMP;
    }
    else if ( lLower == "raw" )
    {
        mFormat = FORMAT_RAW;
    }
    else
    {
        // Default. Can be expected as the user can end up manually
        // editing the persistence file.
        mFormat = FORMAT_BMP;
    }
}