Ejemplo n.º 1
0
/**********************************************************************************************
    errorType STLServerCommandSetNoiseAmplitudeLUTValue::Read(const wxString &m_device)
;will have already read the Socket command type and the command id
A polymorphic Read()
We take a sock as a parameter even though this code has access to the sock
This is because it is called from a base class and some of the polymorphic
classes derived from the base will not have a sock. This overrides that Read(sock)
***********************************************************************************************/
errorType STLServerCommandSetNoiseAmplitudeLUTValueXXX::Read(wxSocketBase &sock)
{
errorType rv;
wxInt16 index;
wxInt16 value;

    sock.SetFlags(wxSOCKET_WAITALL);
	rv=ReadFixedFields(sock);		//reads qflag, at_tick
	if(rv)
		return rv;


//-----Read the index, a wxUint16 in this instance ----

    sock.Read(&index,sizeof(index));   //Read the index
    if(sock.Error())
        return(errFail);
	AppendToReadFromSocketString(index);
//-----Read the value

    sock.Read(&value,sizeof(value));   //Read the value
    if(sock.Error())
        return(errFail);
	AppendToReadFromSocketString(value);

	SetValue(value);
	SetIndex(index);

    SetReadFlag(true);
    return errNone;
}
Ejemplo n.º 2
0
/**********************************************************************************************
    errorType STLServerCommandReset::Read(wxSocketBase sock)
;will have already read the Socket command type and the command id
A polymorphic Read()
We take a sock as a parameter even though this code has access to the sock
This is because it is called from a base class and some of the polymorphic
classes derived from the base will not have a sock. This overrides that Read(sock)
***********************************************************************************************/
errorType STLServerCommandResetXXX::Read(wxSocketBase &sock)
{
errorType rv;

    sock.SetFlags(wxSOCKET_WAITALL);
	rv=ReadFixedFields(sock);		//reads qflag, at_tick
	if(rv)
		return rv;

    FillGSIRecord();
    SetReadFlag(true);
    return errNone;
}
Ejemplo n.º 3
0
errorType STLServerCommandCloseDeviceXXX::Read(wxSocketBase &sock)
{
GSIDevHandle hDev;
errorType rv;

    sock.SetFlags(wxSOCKET_WAITALL);
	rv=ReadFixedFields(sock);		//reads qflag, at_tick
	if(rv)
		return rv;

//reading a string, so first read its length, followed by the buffer
//----read the data length in bytes-----------------       //socket server will understand this format
    GetSock().Read(&hDev,sizeof(hDev));
    if(GetSock().Error())
	    return(errFail);
	AppendToReadFromSocketString(hDev);
	SetDeviceHandle(hDev);
    SetReadFlag(true);
    return errNone;
}
Ejemplo n.º 4
0
/**********************************************************************************************
    errorType STLServerCommandSetFrequency::Read(const wxString &m_device)
;will have already read the Socket command type and the command id
A polymorphic Read()
We take a sock as a parameter even though this code has access to the sock
This is because it is called from a base class and some of the polymorphic
classes derived from the base will not have a sock. This overrides that Read(sock)
***********************************************************************************************/
errorType STLServerCommandSetFrequencyXXX::Read(wxSocketBase &sock)
{
errorType rv;
wxUint16 f;

    sock.SetFlags(wxSOCKET_WAITALL);
	rv=ReadFixedFields(sock);		//reads qflag, at_tick
	if(rv)
		return rv;


//-----Read the data, a wxUint16 in this instance ----

    sock.Read(&f,sizeof(f));   //Read the str
    if(sock.Error())
        return(errFail);
	AppendToReadFromSocketString(f);
	SetFrequency(f);
	FillGSIRecord();

    SetReadFlag(true);
    return errNone;
}