Hauptseite | Klassenhierarchie | Alphabetische Liste | Auflistung der Klassen | Auflistung der Dateien | Klassen-Elemente | Datei-Elemente

Cfps Klassenreferenz

contains all functions working with the fps Mehr...

Klassendiagramm für Cfps:

CTCPIPConnector Aufstellung aller Elemente

Öffentliche Typen

enum  VERBINDUNG { MODEM, NETZWERK, RS232 }
 possible types of connection Mehr...

enum  CONVERT_TO { SPEC, MV, MM }
 possible working units Mehr...


Öffentliche Methoden

 Cfps ()
virtual ~Cfps ()
VERBINDUNG GetCurrentConnectionType (void) const
void SetCurrentConnectionType (const VERBINDUNG eNewConnectionType)
void GetCallnumber (char *pcCallnumber, unsigned int ucBufLen)
 delivers the current number to call by a modem

void SetCallnumber (char *pcNewCallnumber)
 sets the current number to call by a modem

bool GetOperatingState (int &Flags)
 delivers the current operation flags

structure :

bit meaning

0 switch between operation mode ( 0 = Bereich, 1 = Schaltpunkt )
1 ---
2 ---
3 ---
4 ---
5 Update : ( set by fps device when sampling finished )
6 Record : start sampling if bit set
7 ReCalc : transfer values from fps input buffer to fps work buffer


bool SetOperatingState (int Flags)
 Sets the current operating state ( see GetOperationState for details ).

bool ReadSensor (SENSOR_TYPE &CurrentSensorValues)
 Delivers the current values in the fps input buffer into the overgiven structure of type SENSOR_TYPE

structure of SENSOR_TYPE ( defined in the file fps.hpp )

struct SENSOR_TYPE
{
int open; value which means state AUF ( open )
int c; " " " " C
int b; " " " " B
int a; " " " " A
int closed; " " " " ZU ( closed )
};.

bool WriteSensor (SENSOR_TYPE NewSensorValues)
 Writes the overgiven values into the fps input buffer ( see ReadSensor for details ).

bool ReadInterpolatedSensor (SENSOR_TYPE &CurrentSensorValues)
 Read in the fps working buffer ( see ReadSensor for more details ).

bool GetOutOfRangeFlags (int &Flags)
 delivers the "out of range" flags

structure

bit meaning ( if set )

0 Unterspannung ( low voltage )
1 Überspannung ( high voltage )
2 Untertemperatur ( low temperature )
3 Übertemperatur ( high temperature )
4 ---
5 ---
6 ---
7 ---


bool FetchStuetzArrayFromFps (void)
 delivers the stored stuetzstellen ( data points ) from the fps device the read in values are stored in the CFpsConvert class, so you can do some converting right after this

bool StoreStuetzArrayInFps (void)
 stores the current used stuetzstellen ( data points ) into the fps device

void GetTolerance (float &fUnterTolerance, float &fUeberTolerance)
 read in the tolerance values ( this value is stored in the fps in the place of the last stuetzstelle

void SaveTolerance (float fUnterTolerance, float fUeberTolerance)
 saves the tolance value in the fps ( this value is stored in the place of the last stuetzstelle

bool GetSensorSamples (float SenSamp[640], unsigned int uiBegin=0, unsigned int uiLength=640)
 delivers the sample of sensor data from the last sampling ( see GetOperatingState for more details )

bool GetVoltageSamples (float VoltageSample[640], unsigned int uiBegin=0, unsigned int uiLength=640)
 delivers the sample of voltage data from the last sampling ( see GetOperatingState for more details )

bool GetPortBSamples (int PortBSample[640], unsigned int uiBegin=0, unsigned int uiLength=640)
 delivers the sample of PortB data from the last sampling ( see GetCurrentState for more details )

bool GetCurrentSensorValue (float &CurSen, CONVERT_TO eConvertTo=SPEC)
 delivers the current sensor value

bool GetCurrentVoltage (float &CurOperatingVoltage)
 delivers the current voltage of the fps device ( in mV )

bool GetCurrentTemperature (float &CurrentTemperature)
 delivers the current temperature of the fps device ( in °C )

bool GetPortB (int &Flags)
 delivers the current state of the fps device

bit meaning
0 ---
1 ---
2 ---
3 offen ( open )
4 C
5 B
6 A
7 zu ( closed )
8 ---
9 ---
10 ---
11 ---
12 ---
13 ---
14 ---
15 ---


bool StartSampling (void)
 starts the sampling of sensor, voltage and portb data a value will be measured every 30 milliseconds 640 measures will be taken at all

bool IsSamplingDone (bool &bDone)
 tests if the sampling is already done

bool ResetEx (void)
 resets the OutOfRangeFlags writes back the week and year of the production of the fps devise and their serial number

bool GetServiceInfo (int &Week, int &Year, int &Serialnumber)
 delivers the week and year of the production of the fps device and their serialnumber

bool PasswordLogin (char *szIpAddress, char *szPassword, unsigned int uiBasePort, unsigned int uiPortnumber)
 handle the password login use the routine to connect to a password protected gateway

void GetCallNumber (char *pcCallNumber, unsigned int uiBufLen)
 delivers the currently used call number for a modem connection

void SetCallNumber (char *pcNewCallNumber)
 sets the currently used call number for a modem connection

bool InitModem (void)
 connect to modem

virtual bool initialize (void)
 init socket connection

void GetModemInitString (char *pcModemInitString, unsigned int BufLen)
 delivers the string which will be send to modem for initializing ( at commands )

void SetModemInitString (char *pcNewModemInitString)
 sets the string which will be send to modem for initializing ( at commands )

void GetModemDialString (char *pcModemDialString, unsigned int BufLen)
 delivers the string which will be send to modem for dialing ( at commands )

void SetModemDialString (char *pcNewModemDialString)
 sets the string which will be send to modem for dialing ( at commands )

void GetModemOkString (char *pcModemOkString, unsigned int BufLen)
 the modem answers the initializing by sending a string Use this routine to get the string which will be interpreted as a correct initialisation default : OK

void SetModemOkString (char *pcModemOkString)
 the modem answers the initializing by sending a string Use this routine to set the string which will be interpreted as a correct initialisation default : OK

void GetModemConnectString (char *pcModemConnectString, unsigned int BufLen)
 the modem answers the try to connect to another modem by sending a string Use this routine to get the string which will be interpreted as a correct connection default : CONNECT

void SetModemConnectString (char *pcModemConnectString)
 the modem answers the try to connect to another modem by sending a string Use this routine to set the string which will be interpreted as a correct connection default : CONNECT

unsigned int GetModemInitTimeout (void) const
 delivers the timeout value for initializing the modem

void SetModemInitTimeout (const unsigned int uiNewTimeOut)
 sets the timeout value for initializing the modem

unsigned int GetModemDialTimeout (void) const
 delivers the timeout value for establishing a connection with other modem ( dialing )

void SetModemDialTimeout (const unsigned int uiNewTimeoutValue)
 sets the timeout value for establishing a connection with other modem ( dialing )

void SetTcpIpAddress (char const *pcIpAddress)
 sets the tcpipaddress of the fps -device

void GetTcpIpAddress (char *pcIpAddress, SIZE_T BufLen)
 delivers the tcpipaddress of the fps -device

void SetTcpIpPort (unsigned int uiNewPort)
 sets the communication port

unsigned int GetTcpIpPort (void)
 delivers the communication port the default port is 5000

void SetBasePort (const unsigned int nBasePort)
 Set the base port of TCP/IP connection for login.

unsigned int GetBasePort (void) const
 Get the base port of TCP/IP connection for login.

void SetRcvTimeOut (const DWORD dwNewTimeOut)
 sets timeout ( for receiving data )

DWORD GetRcvTimeOut (void) const
 delivers the timeout for receiving data default 5 seconds

void ReadProfileFile (const std::string &sFilename)
 read address data from profile file

void ReadProfileFileConnectionType (const std::string &sFilename)
 read connection type from profile file and set it in the class data.

void WriteProfileFile (std::string sFilename)
 write address data to profile file

bool FetchData (RECEIVED_TYPE &Command, ADDRESS_TYPE &nAddress, unsigned int &uiLength, std::vector< unsigned char > &aucData)
 encapsolated functions in CRcvBuffer

bool StoreData (const RECEIVED_TYPE Command, const ADDRESS_TYPE nAddress, const unsigned int uiLength, const std::vector< unsigned char > &aucData=std::vector< unsigned char >::vector())
 encapsolated functions in CRcvBuffer


Öffentliche Attribute

CFpsConvert m_oConvert
 handle stuetzstellen ( data points ) for converting voltage to mm use this object to convert between :

native and spec ( depends on what is currently used ( switch with SetMeasureMode ) )
spec and native
mV and mm
mm and mV
native and mV
native and mm
mV and native
mm and native



Geschützte Methoden

bool ReadFpsEeprom (ADDRESS_TYPE nAddress, unsigned int uiLength)
 read in a block of data from eeprom memory from fps device the received data will be stored in m_Eeprom

bool ReadFpsProgram (ADDRESS_TYPE nAddress, unsigned int uiLength)
 read in a block of data from program memory from fps device the received data will be stored in m_Program

bool ReadFpsRam (ADDRESS_TYPE nAddress, unsigned int uiLength)
 read in a block of data from ram memory from fps device the received data will be stored in m_Ram

bool WriteFpsEeprom (ADDRESS_TYPE nAddress, unsigned int uiLength, std::vector< unsigned char > aucData)
 write a block of data to eeprom memory in the fps device

bool WriteFpsProgram (ADDRESS_TYPE nAddress, unsigned int uiLength, std::vector< unsigned char > aucData)
 write a block of data to program memory in the fps device

bool WriteFpsRam (ADDRESS_TYPE nAddress, unsigned int uiLength, std::vector< unsigned char > aucData)
 write a block of data to ram memory in the fps device

RECEIVED_TYPE WaitForData (void)
 wait for incoming data timeout = internal timeout


Ausführliche Beschreibung

Version:
1.0
Autor:
Ingo Fröhlich


Dokumentation der Aufzählungstypen

enum Cfps::CONVERT_TO
 

Aufzählungswerte:
SPEC 
MV  use the currently used working unit
MM  use mm

enum Cfps::VERBINDUNG
 

Aufzählungswerte:
MODEM 
NETZWERK  a modem connection
RS232  a direct connection via RS232


Beschreibung der Konstruktoren und Destruktoren

Cfps::Cfps  ) 
 

virtual Cfps::~Cfps  )  [virtual]
 


Dokumentation der Elementfunktionen

bool Cfps::FetchData RECEIVED_TYPE Command,
ADDRESS_TYPE nAddress,
unsigned int &  uiLength,
std::vector< unsigned char > &  aucData
 

bool Cfps::FetchStuetzArrayFromFps void   ) 
 

Zu beachten:
you can store the stuetzstellen ( data points ) with StoreStuetzArrayInFps
Parameter:
--- 
Rückgabe:
true : operation was successfull, false else

unsigned int Cfps::GetBasePort void   )  const
 

Parameter:
base port for login

void Cfps::GetCallNumber char *  pcCallNumber,
unsigned int  uiBufLen
 

Parameter:
returned : buffer in which the current modem number will be stored
length of the buffer ( in bytes )
Rückgabe:
---

void Cfps::GetCallnumber char *  pcCallnumber,
unsigned int  ucBufLen
 

Parameter:
buffer,in which the current number will be stored
length of the buffer
Rückgabe:
---

VERBINDUNG Cfps::GetCurrentConnectionType void   )  const
 

bool Cfps::GetCurrentSensorValue float &  CurSen,
CONVERT_TO  eConvertTo = SPEC
 

the unit in which the return value will be can be specified with the second argument

SPEC => depend on what is currently used ( set / change with SetMeasureMode ) MV => returns mV MM => returns mm

Zu beachten:
default is SPEC
Parameter:
returned current sensor value,
optional the unit of the return value ( see upove for details )
Rückgabe:
true : operation successfull

false else

bool Cfps::GetCurrentTemperature float &  CurrentTemperature  ) 
 

Parameter:
returned the current temperature
Rückgabe:
true operation was successfull

false else

bool Cfps::GetCurrentVoltage float &  CurOperatingVoltage  ) 
 

Parameter:
returned :the current voltage
Rückgabe:
true : operation was successfull, false else

void Cfps::GetModemConnectString char *  pcModemConnectString,
unsigned int  BufLen
 

Parameter:
return connect string
size of the buffer
Rückgabe:
---

void Cfps::GetModemDialString char *  pcModemDialString,
unsigned int  BufLen
 

Zu beachten:
call number will be added, so don't set it here
Parameter:
returned : buffer in which the string will be stored
size of the buffer ( in bytes )
Rückgabe:
---

unsigned int Cfps::GetModemDialTimeout void   )  const
 

Parameter:
--- 
Rückgabe:
the current timeout value

void Cfps::GetModemInitString char *  pcModemInitString,
unsigned int  BufLen
 

Parameter:
returned buffer in which the string will be stored
size of the buffer ( in bytes )
Rückgabe:
---

unsigned int Cfps::GetModemInitTimeout void   )  const
 

Parameter:
--- 
Rückgabe:
the current timeout value

void Cfps::GetModemOkString char *  pcModemOkString,
unsigned int  BufLen
 

Parameter:
return ok string
size of the buffer
Rückgabe:
---

bool Cfps::GetOperatingState int &  Flags  ) 
 

Zu beachten:
You can set the operating state with SetOperatingState
Parameter:
returning flags
Rückgabe:
true : operation was successfull, false else

bool Cfps::GetOutOfRangeFlags int &  Flags  ) 
 

Parameter:
read in flags
Rückgabe:
true : operation was successfull, false else

bool Cfps::GetPortB int &  Flags  ) 
 

Parameter:
returned flags ( see upove for details )
Rückgabe:
true operation was successfull

false else

bool Cfps::GetPortBSamples int  PortBSample[640],
unsigned int  uiBegin = 0,
unsigned int  uiLength = 640
 

Zu beachten:
the data transfer of the whole sampling data takes a lot of time ( about 20 seconds ) You can break it down into small packages, which are more easier to handle by setting the start offset and length of the block you want to read in.
Parameter:
array in which the sampling data will be stored,
optional : start of the block, which will be transfered,
optional : length of the block, which will be transfered
Rückgabe:
true : operation successfull

DWORD Cfps::GetRcvTimeOut void   )  const
 

Parameter:
--- 
Rückgabe:
currently used timout value

bool Cfps::GetSensorSamples float  SenSamp[640],
unsigned int  uiBegin = 0,
unsigned int  uiLength = 640
 

Zu beachten:
the data transfer of the whole sampling data takes a lot of time ( about 20 seconds ) You can break it down into small packages, which are more easier to handle by setting the start offset and length of the block you want to read in.
Parameter:
array in which the sampling data will be stored,
optional : start of the block, which will be transfered,
optional : length of the block, which will be transfered
Rückgabe:
true : operation successfull

bool Cfps::GetServiceInfo int &  Week,
int &  Year,
int &  Serialnumber
 

Parameter:
returned week
returned year
returned serialnumber
Rückgabe:
true operation was successfull

void Cfps::GetTcpIpAddress char *  pcIpAddress,
SIZE_T  BufLen
 

Parameter:
buffer in which the current tcpip address will be stored in,
length of the buffer
Rückgabe:
---

unsigned int Cfps::GetTcpIpPort void   ) 
 

Parameter:
--- 
Rückgabe:
the currently used port number

void Cfps::GetTolerance float &  fUnterTolerance,
float &  fUeberTolerance
 

Parameter:
(+) tolerance value ( in the currently used unit )
(-) tolerance value ( in the currently used unit )
Rückgabe:
---

bool Cfps::GetVoltageSamples float  VoltageSample[640],
unsigned int  uiBegin = 0,
unsigned int  uiLength = 640
 

Zu beachten:
the data transfer of the whole sampling data takes a lot of time ( about 20 seconds ) You can break it down into small packages, which are more easier to handle by setting the start offset and length of the block you want to read in.
Parameter:
array in which the sampling data will be stored,
optional : start of the block, which will be transfered,
optional : length of the block, which will be transfered
Rückgabe:
true : operation successfull

virtual bool Cfps::initialize void   )  [virtual]
 

Set the required data with SetTcpIpAddress and SetTcpIpPort

Parameter:
--- 
Rückgabe:
true connection established

false else

bool Cfps::InitModem void   ) 
 

Zu beachten:
Set the apropriate before ( using ReadProfileFile ) or set it by hand
addtional note : you need to open a connection to the gateway before trying to connect to a modem

When set by hand

Set using

Callnumber SetCallNumber
Initstring ( at commands ) for modem SetModemInitString
Dialstring ( at commands ) for modem SetModemDialString
string indicating a correct initialisation of the modem SetModemOkString
string indicating a correct connection SetModemConnectString

Parameter:
--- 
Rückgabe:
true connect was successfull

false else

bool Cfps::IsSamplingDone bool &  bDone  ) 
 

Parameter:
--- 
Rückgabe:
true sampling is finished

false else

bool Cfps::PasswordLogin char *  szIpAddress,
char *  szPassword,
unsigned int  uiBasePort,
unsigned int  uiPortnumber
 

Parameter:
Tcpip Address of the gateway,
password,@param Baseport ( used for password exchange ),
Port to connect to if password is valid
Rückgabe:
true operation successfull

false else

bool Cfps::ReadFpsEeprom ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[protected]
 

Parameter:
address of the block to read,
length of the block
Rückgabe:
true : operation successfull, false else

bool Cfps::ReadFpsProgram ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[protected]
 

Parameter:
address of the block to read,
length of the block
Rückgabe:
true operation successfull

false else

bool Cfps::ReadFpsRam ADDRESS_TYPE  nAddress,
unsigned int  uiLength
[protected]
 

Parameter:
address of the block to read,
length of the block
Rückgabe:
true operation successfull

false else

bool Cfps::ReadInterpolatedSensor SENSOR_TYPE CurrentSensorValues  ) 
 

Parameter:
read in values ( struct SENSOR_TYPE )
Rückgabe:
operation was successfull, false else

void Cfps::ReadProfileFile const std::string &  sFilename  ) 
 

read in tcpip address, portnumber, receive timeout value and internal used timeout value ( this value will be used as timeout value for communication will the separated received thread ), strings for communication with a modem

Zu beachten:
Default values ( in case of an error ):

tcpip address : localhost ( equals 127.0.0.1 )
port number : 5000
receive timeout : 5 seconds
internal timeout : 5 seconds
Ok string ( modem ) : OK
CONNECT string ( modem ) : CONNECT
Parameter:
filename of the profile file
Rückgabe:
---

void Cfps::ReadProfileFileConnectionType const std::string &  sFilename  ) 
 

Parameter:
filename of the profile file
Rückgabe:
---

bool Cfps::ReadSensor SENSOR_TYPE CurrentSensorValues  ) 
 

Zu beachten:
these values are in native format. Use the CFpsConvert class to convert between native and specific ( mV or mm )
further notice : You can set fps input buffer with WriteSensor

Parameter:
read in values ( struct SENSOR_TYPE )
Rückgabe:
true : operation was successfull, false else

bool Cfps::ResetEx void   ) 
 

Parameter:
--- 
Rückgabe:
true operation was successfull

false else

void Cfps::SaveTolerance float  fUnterTolerance,
float  fUeberTolerance
 

Parameter:
(+) tolerance value ( in the currently used unit )
(-) tolerance value ( in the currently used unit )
Rückgabe:
---

void Cfps::SetBasePort const unsigned int  nBasePort  ) 
 

Parameter:
nBasePort port for login

void Cfps::SetCallNumber char *  pcNewCallNumber  ) 
 

Parameter:
the new call number
Rückgabe:
---

void Cfps::SetCallnumber char *  pcNewCallnumber  ) 
 

Parameter:
the new Callnumber
Rückgabe:
---

void Cfps::SetCurrentConnectionType const VERBINDUNG  eNewConnectionType  ) 
 

void Cfps::SetModemConnectString char *  pcModemConnectString  ) 
 

Parameter:
connect string
Rückgabe:
---

void Cfps::SetModemDialString char *  pcNewModemDialString  ) 
 

Zu beachten:
call number will be added, so don't set it here
Parameter:
new dial string
Rückgabe:
---

void Cfps::SetModemDialTimeout const unsigned int  uiNewTimeoutValue  ) 
 

Parameter:
new timeout value
Rückgabe:
---

void Cfps::SetModemInitString char *  pcNewModemInitString  ) 
 

Zu beachten:
switch off echoing here
Parameter:
new modem init string
Rückgabe:
---

void Cfps::SetModemInitTimeout const unsigned int  uiNewTimeOut  ) 
 

Parameter:
new timeout value
Rückgabe:
---

void Cfps::SetModemOkString char *  pcModemOkString  ) 
 

Parameter:
ok string
Rückgabe:
---

bool Cfps::SetOperatingState int  Flags  ) 
 

Parameter:
flags to set
Rückgabe:
true : operation was successfull, false else

void Cfps::SetRcvTimeOut const DWORD  dwNewTimeOut  ) 
 

Parameter:
new timeout value ( in milli seconds )
Rückgabe:
---

void Cfps::SetTcpIpAddress char const *  pcIpAddress  ) 
 

Parameter:
c - string with the tcpip address
Rückgabe:
---

void Cfps::SetTcpIpPort unsigned int  uiNewPort  ) 
 

Parameter:
port number
Rückgabe:
---

bool Cfps::StartSampling void   ) 
 

Parameter:
--- 
Rückgabe:
true operation was successfull

false else

bool Cfps::StoreData const RECEIVED_TYPE  Command,
const ADDRESS_TYPE  nAddress,
const unsigned int  uiLength,
const std::vector< unsigned char > &  aucData = std::vector< unsigned char >::vector()
 

bool Cfps::StoreStuetzArrayInFps void   ) 
 

Parameter:
--- 
Rückgabe:
true : operation was successfull, false else

RECEIVED_TYPE Cfps::WaitForData void   )  [protected]
 

Parameter:
--- 
Rückgabe:
received command or NONE ( see fps_rcvbuffer.hpp for details )

bool Cfps::WriteFpsEeprom ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
std::vector< unsigned char >  aucData
[protected]
 

Parameter:
address of the block to write,
length of the block,
data to write
Rückgabe:
true operation successfull

false else

bool Cfps::WriteFpsProgram ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
std::vector< unsigned char >  aucData
[protected]
 

Parameter:
address of the block to write,
length of the block,
data to write
Rückgabe:
true operation successfull

false else

bool Cfps::WriteFpsRam ADDRESS_TYPE  nAddress,
unsigned int  uiLength,
std::vector< unsigned char >  aucData
[protected]
 

Parameter:
address of the block to write,
length of the block,
data to write
Rückgabe:
true operation successfull

false else

void Cfps::WriteProfileFile std::string  sFilename  ) 
 

write tcpip address, portnumber, receive timeout value and internal used timeout value ( this value will be used as timeout value for communication will the separated received thread ), strings for communication with a modem

Parameter:
filename of the profile file
Rückgabe:
---

bool Cfps::WriteSensor SENSOR_TYPE  NewSensorValues  ) 
 

Parameter:
values to write ( struct SENSOR_TYPE )
Rückgabe:
true : operation was successfull, false else


Dokumentation der Datenelemente

CFpsConvert Cfps::m_oConvert
 


Die Dokumentation für diese Klasse wurde erzeugt aufgrund der Datei:
Erzeugt am Tue Mar 11 14:25:19 2008 für SchunkFPSAPI von doxygen 1.3.7