- update instruments configurations
- new six version with status display - bugfixes on TecsClient - some changed samp. env. devices
This commit is contained in:
@@ -16,6 +16,29 @@ static char response[COC_RES_LEN];
|
||||
static char *rwCode="rwacs";
|
||||
static char *rdCode="rdacs";
|
||||
|
||||
pTecsClient TeccStart(char *startcmd, char *host, int port) {
|
||||
CocConn *conn;
|
||||
char *code, *cmd, thishost[64], *th;
|
||||
int iret;
|
||||
|
||||
NEW(conn, CocConn);
|
||||
code=rwCode;
|
||||
cmd=startcmd;
|
||||
if (host[0]!='\0') {
|
||||
gethostname(thishost, sizeof(thishost));
|
||||
th=getenv(thishost);
|
||||
if (th==NULL) th=thishost;
|
||||
if (0!=strcmp(th, host)) {
|
||||
code=rdCode;
|
||||
cmd="";
|
||||
}
|
||||
}
|
||||
ERR_I(iret=CocInitClient(conn, host, port, code, 0, cmd));
|
||||
if (iret==1) ErrShort("TECS_INIT: can not connect to TecsServer");
|
||||
return((pTecsClient)conn);
|
||||
OnError: return(NULL);
|
||||
}
|
||||
|
||||
pTecsClient TeccInit(char *startcmd, int port) {
|
||||
CocConn *conn=NULL;
|
||||
char *code, host[64];
|
||||
@@ -37,27 +60,6 @@ pTecsClient TeccInit(char *startcmd, int port) {
|
||||
return(NULL);
|
||||
}
|
||||
|
||||
pTecsClient TeccStart(char *startcmd, char *host, int port) {
|
||||
CocConn *conn;
|
||||
char *code, *cmd, thishost[64];
|
||||
int iret;
|
||||
|
||||
NEW(conn, CocConn);
|
||||
code=rwCode;
|
||||
cmd=startcmd;
|
||||
if (host[0]!='\0') {
|
||||
gethostname(thishost, sizeof(thishost));
|
||||
if (0!=strcmp(thishost, host)) {
|
||||
code=rdCode;
|
||||
cmd="";
|
||||
}
|
||||
}
|
||||
ERR_I(iret=CocInitClient(conn, host, port, code, 0, cmd));
|
||||
if (iret==1) ErrShort("TECS_INIT: can not connect to TecsServer");
|
||||
return((pTecsClient)conn);
|
||||
OnError: return(NULL);
|
||||
}
|
||||
|
||||
int TeccGet3(pTecsClient conn, float *tC, float *tX, float *tP) {
|
||||
int iret;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user