Cat
|
#include <inc/Server_NI6008.h>
Public Types | |
enum | MsgLevel { VERBOSE =-6, DEBUG, INFO, WARNING, ERR, FATAL, NONE } |
enum | MsgColor { BLUE, GREEN, WHITE, MAGENTA, YELLOW, RED, CYAN } |
Public Member Functions | |
Server_NI6008 (int) | |
virtual | ~Server_NI6008 () |
Standard constructor. More... | |
void | error (const char *) |
void | start () |
int | cmd () |
int | AI (const char *, double[]) |
int | AO (const char *, double[]) |
int | AO0 (double) |
int | AO1 (double) |
int | DI (const char *, unsigned char[]) |
int | Reset () |
void | status () |
int | send (std::string word) |
void | msgSvc (MsgLevel, std::string, std::string call=std::string("")) |
void | setLineLength (int length) |
void | setCallSize (int size) |
void | log (MsgLevel, std::string, std::string) |
void | setAIRange (double min=-10., double max=10.) |
void | setAORange (double min=0., double max=5.) |
void | setTimeout (double timeout=10.0) |
Private Member Functions | |
std::string | logtime () |
Private Attributes | |
int | sockfd |
int | newsockfd |
int | portno |
std::string | ni6008 |
socklen_t | clilen |
char | buffer [256] |
struct sockaddr_in serv_addr | cli_addr |
int | n |
std::vector< std::string > | colors |
int | callSize |
int | lineLength |
double | m_aiMin |
double | m_aiMax |
double | m_aoMin |
double | m_aoMax |
double | m_timeout |
Definition at line 103 of file Server_NI6008.h.
Enumerator | |
---|---|
BLUE | |
GREEN | |
WHITE | |
MAGENTA | |
YELLOW | |
RED | |
CYAN |
Definition at line 130 of file Server_NI6008.h.
Enumerator | |
---|---|
VERBOSE | |
DEBUG | |
INFO | |
WARNING | |
ERR | |
FATAL | |
NONE |
Definition at line 129 of file Server_NI6008.h.
Server_NI6008::Server_NI6008 | ( | int | port | ) |
Definition at line 25 of file Server_NI6008.cpp.
References accountName(), colors, hostName(), INFO, itos(), msgSvc(), osName(), osVersion(), portno, start(), and WARNING.
|
virtual |
int Server_NI6008::AI | ( | const char * | , |
double | [] | ||
) |
Definition at line 368 of file Server_NI6008.cpp.
References DAQmxErrChk, error(), and m_timeout.
Referenced by cmd().
int Server_NI6008::AO | ( | const char * | , |
double | [] | ||
) |
Definition at line 428 of file Server_NI6008.cpp.
References DAQmxErrChk, error(), m_aoMax, m_aoMin, and m_timeout.
Referenced by cmd().
int Server_NI6008::AO0 | ( | double | data | ) |
Definition at line 554 of file Server_NI6008.cpp.
References DAQmxErrChk, error(), INFO, m_aoMax, m_aoMin, m_timeout, and msgSvc().
int Server_NI6008::AO1 | ( | double | data | ) |
Definition at line 607 of file Server_NI6008.cpp.
References DAQmxErrChk, error(), INFO, m_aoMax, m_aoMin, m_timeout, and msgSvc().
int Server_NI6008::cmd | ( | ) |
Definition at line 223 of file Server_NI6008.cpp.
References AI(), AO(), buffer, shell::data(), DI(), error(), msgSvc(), n, newsockfd, Reset(), send(), setAIRange(), setAORange(), setTimeout(), cat::size, sockfd, and WARNING.
Referenced by start().
int Server_NI6008::DI | ( | const char * | , |
unsigned char | [] | ||
) |
Definition at line 483 of file Server_NI6008.cpp.
References DAQmxErrChk, error(), and m_timeout.
Referenced by cmd().
void Server_NI6008::error | ( | const char * | msg | ) |
void Server_NI6008::log | ( | MsgLevel | level, |
std::string | msg, | ||
std::string | call | ||
) |
Definition at line 118 of file Server_NI6008.cpp.
References BLUE, callSize, colors, CYAN, DEBUG, ERR, FATAL, GREEN, INFO, logtime(), MAGENTA, RED, VERBOSE, WARNING, WHITE, and YELLOW.
Referenced by msgSvc(), and setCallSize().
|
private |
Definition at line 103 of file Server_NI6008.cpp.
Referenced by log().
void Server_NI6008::msgSvc | ( | MsgLevel | level, |
std::string | msg, | ||
std::string | call = std::string("") |
||
) |
Definition at line 92 of file Server_NI6008.cpp.
Referenced by AO0(), AO1(), cmd(), Reset(), Server_NI6008(), setAIRange(), and setAORange().
int Server_NI6008::Reset | ( | ) |
Definition at line 546 of file Server_NI6008.cpp.
References INFO, and msgSvc().
Referenced by cmd().
|
inline |
Definition at line 117 of file Server_NI6008.h.
|
inline |
Definition at line 138 of file Server_NI6008.h.
References FATAL, ftos(), m_aiMax, m_aiMin, and msgSvc().
Referenced by cmd().
|
inline |
Definition at line 146 of file Server_NI6008.h.
References FATAL, ftos(), m_aoMax, m_aoMin, and msgSvc().
Referenced by cmd().
|
inline |
|
inline |
|
inline |
void Server_NI6008::start | ( | ) |
void Server_NI6008::status | ( | ) |
|
private |
Definition at line 162 of file Server_NI6008.h.
|
private |
Definition at line 166 of file Server_NI6008.h.
Referenced by log(), and setCallSize().
|
private |
Definition at line 163 of file Server_NI6008.h.
Referenced by start().
|
private |
Definition at line 161 of file Server_NI6008.h.
Referenced by start().
|
private |
Definition at line 165 of file Server_NI6008.h.
Referenced by log(), and Server_NI6008().
|
private |
Definition at line 167 of file Server_NI6008.h.
Referenced by setLineLength().
|
private |
Definition at line 170 of file Server_NI6008.h.
Referenced by setAIRange(), and status().
|
private |
Definition at line 170 of file Server_NI6008.h.
Referenced by setAIRange(), and status().
|
private |
Definition at line 171 of file Server_NI6008.h.
Referenced by AO(), AO0(), AO1(), setAORange(), and status().
|
private |
Definition at line 171 of file Server_NI6008.h.
Referenced by AO(), AO0(), AO1(), setAORange(), and status().
|
private |
Definition at line 172 of file Server_NI6008.h.
Referenced by AI(), AO(), AO0(), AO1(), DI(), setTimeout(), and status().
|
private |
Definition at line 164 of file Server_NI6008.h.
Referenced by cmd().
|
private |
Definition at line 159 of file Server_NI6008.h.
|
private |
Definition at line 160 of file Server_NI6008.h.
|
private |
Definition at line 159 of file Server_NI6008.h.
Referenced by Server_NI6008(), start(), and status().
|
private |
Definition at line 159 of file Server_NI6008.h.