예제 #1
0
void CShake::KeyValue( KeyValueData *pkvd )
{
	if (FStrEq(pkvd->szKeyName, "amplitude"))
	{
		SetAmplitude( atof(pkvd->szValue) );
		pkvd->fHandled = TRUE;
	}
	else if (FStrEq(pkvd->szKeyName, "frequency"))
	{
		SetFrequency( atof(pkvd->szValue) );
		pkvd->fHandled = TRUE;
	}
	else if (FStrEq(pkvd->szKeyName, "duration"))
	{
		SetDuration( atof(pkvd->szValue) );
		pkvd->fHandled = TRUE;
	}
	else if (FStrEq(pkvd->szKeyName, "radius"))
	{
		SetRadius( atof(pkvd->szValue) );
		pkvd->fHandled = TRUE;
	}
	else
		CPointEntity::KeyValue( pkvd );
}
예제 #2
0
/*************************************************************************
    errorType STLServerCommandSetAmplitudeSPL::Read(wxSocketBase s&ock)
will have already read the Socket command type and the command id
now need to read the command specific data from the client.
Should only be called from a GSISocket server or derived class

Note that the corresponding ::Write function will be waiting for a
ServerReturnRecord. This function does not return this record as it
doesn't know if the task was completed without error.
The calling code will need to perform the required hardware (or other) tasks
and return the ServerReturnRecord indicating status of the function

*************************************************************************/
errorType STLServerCommandSetAmplitudeSPLXXX::Read(wxSocketBase & sock)
{
//read amplitude
	wxInt16 amplitude;
errorType rv;

	rv=ReadFixedFields(GetSock());		//reads qflag, at_tick
	sock.Read(&amplitude,sizeof(amplitude));
	SetReadFlag(true);
	AppendToReadFromSocketString(amplitude);
    if(sock.Error())
	{
		MapWxSocketError sockErr(sock.LastError());
		SetLastError(sockErr.GetErrorType());
        return(sockErr.GetErrorType());
	}
	SetAmplitude(amplitude);
	FillGSIRecord();				//perform LUT conversion
    return errNone;
}
예제 #3
0
//-----------------------------------------------------------------------------
// Purpose: Handles changes to the shake amplitude from an external source.
//-----------------------------------------------------------------------------
void CASWEnvShake::InputAmplitude( inputdata_t &inputdata )
{
	SetAmplitude( inputdata.value.Float() );
	ApplyShake( SHAKE_AMPLITUDE );
}