- Added back calculation from motor positions to Q/E variables into
TAS code. - Fixed communication problems in SerPortServer, mainly with terminator detection. - Added SPS switched motors for TOPSI - Debugged Power-PC histogram memory software for TRICS
This commit is contained in:
@@ -69,6 +69,8 @@
|
||||
** *serPortTrace -trace Turn on tracing.
|
||||
** *serPortTraceSize -tsize 0x40000 (= 256k) Trace buffer size.
|
||||
** *serPortPeriod -period 60 Period for writing trace time-stamps
|
||||
** *serPortMax -max 20 Maximum number of serial ports
|
||||
** to use
|
||||
**
|
||||
** A value given via -name will be converted to lowercase before being used.
|
||||
**---------------------------------------------------------------------------
|
||||
@@ -173,8 +175,8 @@
|
||||
#endif
|
||||
|
||||
#define RS__MAX_CLIENTS 8 /* Up to 8 clients will be supported */
|
||||
#define RS__MAX_ASYNCH 20 /* Asynch "ports" 0 - 19 will be allowed */
|
||||
#define MAX_OPEN_CHANS RS__MAX_ASYNCH
|
||||
static int RS__MAX_ASYNCH = 20; /* Asynch "ports" 0 - 19 will be allowed */
|
||||
#define MAX_OPEN_CHANS 20
|
||||
|
||||
#define MAX_PKT_SIZE 10000 /* The SerPortServer packet protocol has a
|
||||
** 4 char ASCII header giving the packet length.
|
||||
@@ -902,6 +904,7 @@
|
||||
bytes_to_come -= status;
|
||||
p_nxt_byte += status;
|
||||
}
|
||||
|
||||
if (bytes_to_come != 0) {
|
||||
printf ("recv: Did not get all of expected data on "
|
||||
"socket %d.\n", Cl_info[indx].skt);
|
||||
@@ -1254,7 +1257,7 @@
|
||||
char *buff, /* In -- Pntr to buffer to search */
|
||||
int nch) { /* In -- The number of chars in buff */
|
||||
|
||||
int i, j;
|
||||
int i, j, noTerm = -1, nLen = -1;
|
||||
|
||||
if (nterm <= 0) {
|
||||
*len = nch; /* No terminator. So return complete string */
|
||||
@@ -1262,13 +1265,18 @@
|
||||
return False;
|
||||
}else { /* Search string for a terminator */
|
||||
for (i = 0; i < nch; i++) {
|
||||
for (j = 0; j < nterm; j++) if (buff[i] == terms[j]) break;
|
||||
if (buff[i] == terms[j]) break;
|
||||
for (j = 0; j < nterm; j++) {
|
||||
if (buff[i] == terms[j]) {
|
||||
/* replace terminator with NIL */
|
||||
buff[i] = NIL; /* replace terminator with NIL */
|
||||
noTerm = j;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
*len = i;
|
||||
if (buff[i] == terms[j]) { /* Was a terminator found? */
|
||||
*term = terms[j]; /* Yes. Return it */
|
||||
buff[i] = NIL; /* Replace the terminator with a NIL */
|
||||
if (noTerm >= 0 ) { /* Was a terminator found? */
|
||||
*term = terms[noTerm]; /* Yes. Return it */
|
||||
*len += 1; /* And include the term in the length */
|
||||
return True;
|
||||
}else {
|
||||
@@ -1585,7 +1593,7 @@
|
||||
}
|
||||
Cl_info[cl_indx].nxt_cmnd_ptr = nxt_cmnd_ptr;
|
||||
Cl_info[cl_indx].nxt_rply_ptr0 = nxt_rply_ptr0;
|
||||
Cl_info[cl_indx].nxt_rply_ptr1 = nxt_rply_ptr1;
|
||||
Cl_info[cl_indx].nxt_rply_ptr1 = nxt_rply_ptr1;
|
||||
|
||||
if (Ts_info[ts_indx].tmo < Next_tmo_secs)
|
||||
Next_tmo_secs = Ts_info[ts_indx].tmo;
|
||||
@@ -1745,6 +1753,7 @@
|
||||
{"-tsize", ".serPortTraceSize", XrmoptionSepArg, (XPointer) NULL},
|
||||
{"-period", ".serPortPeriod", XrmoptionSepArg, (XPointer) NULL},
|
||||
{"-debug", ".serPortDebug", XrmoptionNoArg, (XPointer) "1"},
|
||||
{"-max", ".serPortMax", XrmoptionSepArg, (XPointer) NULL},
|
||||
};
|
||||
|
||||
static char our_name[80] = "Unknown"; /* This holds the program name */
|
||||
@@ -2333,6 +2342,19 @@
|
||||
"ProgramName.Values",
|
||||
&type, &value);
|
||||
Debug = (status) ? True : False;
|
||||
/* - - - - - - - - - - - - - - - - - - - - - - - - -max */
|
||||
status = XrmGetResource (my_db,
|
||||
StrJoin (buff, sizeof (buff),
|
||||
appName, ".serPortMax"),
|
||||
"ProgramName.Values",
|
||||
&type, &value);
|
||||
if (!status ||
|
||||
(sscanf (value.addr, "%d", &RS__MAX_ASYNCH) != 1)) {
|
||||
RS__MAX_ASYNCH = 20;
|
||||
printf (" Max Serial Lines defaulting to %d\n", RS__MAX_ASYNCH);
|
||||
}else {
|
||||
printf (" Max Serial Lines Taken = %d\n", RS__MAX_ASYNCH);
|
||||
}
|
||||
/*-----------------------------------------------------------------------*/
|
||||
N_clients = N_open_chans = 0;
|
||||
|
||||
@@ -2441,6 +2463,10 @@
|
||||
if (Ts_info[i].status != TS_SS_IDLE) {
|
||||
if (subtractTimes (time_now, Ts_info[i].time_stamp) >=
|
||||
Ts_info[i].tmo) {
|
||||
subtractTimes(time_now, Ts_info[i].time_stamp);
|
||||
printf("TMO: Difference: %f, allowed %f\n",
|
||||
subtractTimes(time_now, Ts_info[i].time_stamp),
|
||||
Ts_info[i],tmo);
|
||||
handleTmo (i); /* This channel has timed-out! */
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user