Change obsoleted eStatus logging to eLog or eValue
This commit is contained in:
@@ -541,7 +541,7 @@ static long long unit2count(pDMC2280Driv self, double target) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "unit2count motor %s has no absolute encoder",
|
||||
self->name);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
return -1;
|
||||
}
|
||||
/* distance of target from home in units */
|
||||
@@ -559,7 +559,7 @@ static long long unit2count(pDMC2280Driv self, double target) {
|
||||
if (self->debug) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "unit2count Rounding %f to %lld", absolute, result);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -570,7 +570,7 @@ static double count2unit(pDMC2280Driv self, long long counts) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "unit2count motor %s has no absolute encoder",
|
||||
self->name);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
return -1;
|
||||
}
|
||||
fPos = (counts - self->absEncHome) / self->cntsPerX + self->fHome;
|
||||
@@ -720,7 +720,7 @@ static int motAbsol(pDMC2280Driv self, double target) {
|
||||
if (self->debug) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "motAbsol Rounding %f to %d", absolute, result);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
@@ -781,7 +781,7 @@ static int motCreep(pDMC2280Driv self, double target) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "Motor=%s creep stopped, stepcount = %d",
|
||||
self->name, self->stepCount);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
iRet = 1;
|
||||
}
|
||||
@@ -800,7 +800,7 @@ static int motCreep(pDMC2280Driv self, double target) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "CREEP: cur=%d, target=%d, offset=%d, new=%d",
|
||||
self->currSteps, target_steps, offset, self->currSteps + offset);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
/*
|
||||
* We don't want to handle each case separately, so fold negative into positive case
|
||||
@@ -845,13 +845,13 @@ static int motCreep(pDMC2280Driv self, double target) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "CREEP: Motor=%s, preseek=%d, creep_val=%d, cur_steps=%d",
|
||||
self->name, self->preseek, self->creep_val, self->currSteps);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
snprintf(line, CMDLEN, "CREEP: Motor=%s, fPreseek=%f, fTarget=%f, target=%f, tgt_steps=%d",
|
||||
self->name, self->fPreseek, self->fTarget, target, target_steps);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
snprintf(line, CMDLEN, "CREEP: cur=%d, target=%d, offset=%d, new=%d",
|
||||
self->currSteps, target_steps, offset, self->currSteps + offset);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
/*
|
||||
* The new absolute step target is the current step position plus
|
||||
@@ -927,7 +927,7 @@ static int DMC_Rx(pAsyncProtocol p, pAsyncTxn ctx, int rxchar) {
|
||||
myCmd->inp_buf[myCmd->inp_idx] = '\0';
|
||||
if (strncmp(myCmd->inp_buf, myCmd->out_buf, myCmd->out_len) == 0) {
|
||||
int i;
|
||||
SICSLogWrite("Line echo detected", eStatus);
|
||||
SICSLogWrite("Line echo detected", eLog);
|
||||
for (i = myCmd->out_len; i <= myCmd->inp_idx; ++i) {
|
||||
myCmd->inp_buf[i - myCmd->out_len] = myCmd->inp_buf[i];
|
||||
}
|
||||
@@ -966,8 +966,8 @@ static int SendCallback(pAsyncTxn pCmd) {
|
||||
|
||||
if (pCmd->txn_status == ATX_TIMEOUT) {
|
||||
if (self->debug) {
|
||||
SICSLogWrite(pCmd->out_buf, eStatus);
|
||||
SICSLogWrite("<TIMEOUT>", eStatus);
|
||||
SICSLogWrite(pCmd->out_buf, eLog);
|
||||
SICSLogWrite("<TIMEOUT>", eLog);
|
||||
}
|
||||
strncpy(self->lastCmd, pCmd->out_buf, CMDLEN);
|
||||
self->errorCode = MOTCMDTMO;
|
||||
@@ -978,8 +978,8 @@ static int SendCallback(pAsyncTxn pCmd) {
|
||||
case ' ': /* leading blank */
|
||||
case '-': /* leading minus sign */
|
||||
if (self->debug) {
|
||||
SICSLogWrite(cmnd, eStatus);
|
||||
SICSLogWrite(resp, eStatus);
|
||||
SICSLogWrite(cmnd, eLog);
|
||||
SICSLogWrite(resp, eLog);
|
||||
}
|
||||
break;
|
||||
case '?':
|
||||
@@ -994,8 +994,8 @@ static int SendCallback(pAsyncTxn pCmd) {
|
||||
if ((cmnd[0] == 'M' && cmnd[1] == 'G') || (cmnd[0] == 'L' && cmnd[1] == 'V')) {
|
||||
/* MG and LV commands can produce this result */
|
||||
if (self->debug) {
|
||||
SICSLogWrite(cmnd, eStatus);
|
||||
SICSLogWrite(resp, eStatus);
|
||||
SICSLogWrite(cmnd, eLog);
|
||||
SICSLogWrite(resp, eLog);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1051,7 +1051,7 @@ static int DMC_SendReceive(pDMC2280Driv self, char *cmd, char* reply) {
|
||||
|
||||
if (status != 1) {
|
||||
if (self->debug)
|
||||
SICSLogWrite(cmd, eStatus);
|
||||
SICSLogWrite(cmd, eLog);
|
||||
if (status == -1)
|
||||
self->errorCode = MOTCMDTMO;
|
||||
else
|
||||
@@ -1062,15 +1062,15 @@ static int DMC_SendReceive(pDMC2280Driv self, char *cmd, char* reply) {
|
||||
switch (reply[0]) {
|
||||
case ':': /* prompt */
|
||||
if (self->debug) {
|
||||
SICSLogWrite(cmd, eStatus);
|
||||
SICSLogWrite(reply, eStatus);
|
||||
SICSLogWrite(cmd, eLog);
|
||||
SICSLogWrite(reply, eLog);
|
||||
}
|
||||
return SUCCESS;
|
||||
case ' ': /* leading blank */
|
||||
case '-': /* leading minus sign */
|
||||
if (self->debug) {
|
||||
SICSLogWrite(cmd, eStatus);
|
||||
SICSLogWrite(reply, eStatus);
|
||||
SICSLogWrite(cmd, eLog);
|
||||
SICSLogWrite(reply, eLog);
|
||||
}
|
||||
return SUCCESS;
|
||||
case '?':
|
||||
@@ -1085,8 +1085,8 @@ static int DMC_SendReceive(pDMC2280Driv self, char *cmd, char* reply) {
|
||||
if ((cmd[0] == 'M' && cmd[1] == 'G') || (cmd[0] == 'L' && cmd[1] == 'V')) {
|
||||
/* MG and LV commands can produce this result */
|
||||
if (self->debug) {
|
||||
SICSLogWrite(cmd, eStatus);
|
||||
SICSLogWrite(reply, eStatus);
|
||||
SICSLogWrite(cmd, eLog);
|
||||
SICSLogWrite(reply, eLog);
|
||||
}
|
||||
return SUCCESS;
|
||||
}
|
||||
@@ -1692,9 +1692,9 @@ static int rspStatus(pDMC2280Driv self, const char* text) {
|
||||
}
|
||||
snprintf(line, CMDLEN, "Motor %s limits: %s", self->name, sw);
|
||||
if (trace_switches)
|
||||
ServerWriteGlobal(line, eStatus);
|
||||
ServerWriteGlobal(line, eLog);
|
||||
else
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
if ((self->currFlags & (32)) != (iFlags & (32))) {
|
||||
if (iFlags & (32)) {
|
||||
@@ -1706,9 +1706,9 @@ static int rspStatus(pDMC2280Driv self, const char* text) {
|
||||
}
|
||||
snprintf(line, CMDLEN, "Motor %s motor: %s", self->name, sw);
|
||||
if (trace_switches)
|
||||
ServerWriteGlobal(line, eStatus);
|
||||
ServerWriteGlobal(line, eLog);
|
||||
else
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
if ((self->currFlags & (128)) != (iFlags & (128))) {
|
||||
if (iFlags & (128)) {
|
||||
@@ -1720,9 +1720,9 @@ static int rspStatus(pDMC2280Driv self, const char* text) {
|
||||
}
|
||||
snprintf(line, CMDLEN, "Motor %s motor: %s", self->name, sw);
|
||||
if (trace_switches)
|
||||
ServerWriteGlobal(line, eStatus);
|
||||
ServerWriteGlobal(line, eLog);
|
||||
else
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
}
|
||||
self->currFlags = iFlags;
|
||||
@@ -1831,8 +1831,8 @@ static void state_trace_prn(pDMC2280Driv self) {
|
||||
if (line && *line) {
|
||||
if (lines_printed == 0)
|
||||
/* print the opening message only if there are lines to print */
|
||||
SICSLogTimePrintf(eStatus, &tv, "Motor: %s, state_trace_prn trace history listing start", self->name);
|
||||
SICSLogWriteTime(line, eStatus, tp);
|
||||
SICSLogTimePrintf(eLog, &tv, "Motor: %s, state_trace_prn trace history listing start", self->name);
|
||||
SICSLogWriteTime(line, eLog, tp);
|
||||
lines_printed++;
|
||||
}
|
||||
self->state_trace_done[idx] = 1;
|
||||
@@ -1840,9 +1840,9 @@ static void state_trace_prn(pDMC2280Driv self) {
|
||||
idx = 0;
|
||||
} while (idx != self->state_trace_idx);
|
||||
/* print a close message, even if there are zero lines */
|
||||
SICSLogTimePrintf(eStatus, &tv, "Motor: %s, state_trace_prn trace history listing end (%d entries)", self->name, lines_printed);
|
||||
SICSLogTimePrintf(eLog, &tv, "Motor: %s, state_trace_prn trace history listing end (%d entries)", self->name, lines_printed);
|
||||
#else
|
||||
SICSLogPrintf(eStatus, "Motor: %s, state_trace_prn not implemented", self->name);
|
||||
SICSLogPrintf(eLog, "Motor: %s, state_trace_prn not implemented", self->name);
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1993,9 +1993,9 @@ static void state_trace_ins(pDMC2280Driv self, const char *fmt, ...) {
|
||||
vsnprintf(lp, CMDLEN, format, ap);
|
||||
va_end(ap);
|
||||
if (self->debug)
|
||||
SICSLogWrite(lp, eStatus);
|
||||
SICSLogWrite(lp, eLog);
|
||||
if (self->trace)
|
||||
SCWrite(self->trace, lp, eStatus);
|
||||
SCWrite(self->trace, lp, eLog);
|
||||
}
|
||||
#if defined(STATE_TRACE) && (STATE_TRACE > 0)
|
||||
if (++self->state_trace_idx >= STATE_TRACE)
|
||||
@@ -2689,7 +2689,7 @@ static void DMCState_MotorOn(pDMC2280Driv self, pEvtEvent event) {
|
||||
self->currPosition,
|
||||
self->fPreseek,
|
||||
self->fTarget);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
self->creep_val = 0;
|
||||
absolute = motCreep(self, target);
|
||||
@@ -2954,7 +2954,7 @@ static void DMCState_BacklashCont(pDMC2280Driv self, pEvtEvent event) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "Motor=%s preseek stopped, stepcount = %d",
|
||||
self->name, self->stepCount);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
self->preseek = 0;
|
||||
}
|
||||
@@ -3387,7 +3387,7 @@ static void DMCState_StepMove(pDMC2280Driv self, pEvtEvent event) {
|
||||
self->minRatio,
|
||||
self->maxRatio,
|
||||
time);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
if (self->abs_encoder && true /*self->doStats*/) {
|
||||
if (labs(steps) > fabs(self->stepsPerX) && labs(counts) > fabs(self->cntsPerX)) {
|
||||
@@ -3412,7 +3412,7 @@ static void DMCState_StepMove(pDMC2280Driv self, pEvtEvent event) {
|
||||
self->S_xx,
|
||||
self->S_yy,
|
||||
self->S_xy);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
snprintf(line, CMDLEN, "Motor=%s stats: n=%.0f, m=%f, b=%f, r=%f, stepsPerX=%f",
|
||||
self->name,
|
||||
self->S_n,
|
||||
@@ -3420,7 +3420,7 @@ static void DMCState_StepMove(pDMC2280Driv self, pEvtEvent event) {
|
||||
self->S_b,
|
||||
self->S_r,
|
||||
self->cntsPerX * self->S_m);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3569,7 +3569,7 @@ static void DMCState_Moving(pDMC2280Driv self, pEvtEvent event) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "Motor=%s preseek stopped, stepcount = %d",
|
||||
self->name, self->stepCount);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
self->preseek = 0;
|
||||
absolute = motCreep(self, target);
|
||||
@@ -3585,7 +3585,7 @@ static void DMCState_Moving(pDMC2280Driv self, pEvtEvent event) {
|
||||
self->fPreseek,
|
||||
absolute - self->currSteps,
|
||||
self->creep_val);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
}
|
||||
else {
|
||||
@@ -3601,7 +3601,7 @@ static void DMCState_Moving(pDMC2280Driv self, pEvtEvent event) {
|
||||
self->fPreseek,
|
||||
absolute - self->currSteps,
|
||||
self->creep_val);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -3615,7 +3615,7 @@ static void DMCState_Moving(pDMC2280Driv self, pEvtEvent event) {
|
||||
self->currPosition,
|
||||
self->fPreseek,
|
||||
self->fTarget);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
/*
|
||||
* If we are still iterating, continue
|
||||
@@ -3626,7 +3626,7 @@ static void DMCState_Moving(pDMC2280Driv self, pEvtEvent event) {
|
||||
char line[CMDLEN];
|
||||
snprintf(line, CMDLEN, "Motor=%s motion stopped, absolute = %d",
|
||||
self->name, absolute);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
self->preseek = 0;
|
||||
}
|
||||
@@ -3674,7 +3674,7 @@ static void DMCState_Moving(pDMC2280Driv self, pEvtEvent event) {
|
||||
self->minRatio,
|
||||
self->maxRatio,
|
||||
time);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
}
|
||||
change_state(self, DMCState_OffTimer);
|
||||
return;
|
||||
@@ -4821,14 +4821,14 @@ static int DMC2280SetPar(void *pData, SConnection *pCon,
|
||||
*/
|
||||
static void DMC2280StrList(pDMC2280Driv self, char *name, SConnection *pCon){
|
||||
|
||||
SCPrintf(pCon, eStatus, "%s.part = %s\n", name, self->part);
|
||||
SCPrintf(pCon, eStatus, "%s.long_name = %s\n", name, self->long_name);
|
||||
SCPrintf(pCon, eStatus, "%s.axis = %c\n", name, self->axisLabel);
|
||||
SCPrintf(pCon, eStatus, "%s.legacy_fsm = %s\n", name, self->legacy_fsm ? "ON" : "OFF");
|
||||
SCPrintf(pCon, eValue, "%s.part = %s\n", name, self->part);
|
||||
SCPrintf(pCon, eValue, "%s.long_name = %s\n", name, self->long_name);
|
||||
SCPrintf(pCon, eValue, "%s.axis = %c\n", name, self->axisLabel);
|
||||
SCPrintf(pCon, eValue, "%s.legacy_fsm = %s\n", name, self->legacy_fsm ? "ON" : "OFF");
|
||||
if (self->encoderAxis) {
|
||||
SCPrintf(pCon, eStatus, "%s.encoderAxis = %c\n", name, self->encoderAxis);
|
||||
SCPrintf(pCon, eValue, "%s.encoderAxis = %c\n", name, self->encoderAxis);
|
||||
}
|
||||
SCPrintf(pCon, eStatus, "%s.units = %s\n", name, self->units);
|
||||
SCPrintf(pCon, eValue, "%s.units = %s\n", name, self->units);
|
||||
if (self->asyncUnit) {
|
||||
mkChannel* sock = AsyncUnitGetSocket(self->asyncUnit);
|
||||
if (sock) {
|
||||
@@ -4836,14 +4836,14 @@ static void DMC2280StrList(pDMC2280Driv self, char *name, SConnection *pCon){
|
||||
int port = ntohs(sock->adresse.sin_port);
|
||||
strncpy(addr, inet_ntoa(sock->adresse.sin_addr), 80);
|
||||
addr[79] = '\0';
|
||||
SCPrintf(pCon, eStatus, "%s.address = %s:%d\n", self->name, addr, port);
|
||||
SCPrintf(pCon, eValue, "%s.address = %s:%d\n", self->name, addr, port);
|
||||
}
|
||||
}
|
||||
if (self->errorCode) {
|
||||
int iCode;
|
||||
char error[CMDLEN];
|
||||
DMC2280Error(self, &iCode, error, CMDLEN);
|
||||
SCPrintf(pCon, eStatus, "%s.error = %d:%s", self->name, iCode, error);
|
||||
SCPrintf(pCon, eValue, "%s.error = %d:%s", self->name, iCode, error);
|
||||
}
|
||||
return;
|
||||
}
|
||||
@@ -4855,45 +4855,45 @@ static void DMC2280StrList(pDMC2280Driv self, char *name, SConnection *pCon){
|
||||
static void DMC2280List(void *pData, char *name, SConnection *pCon){
|
||||
pDMC2280Driv self = (pDMC2280Driv) pData;
|
||||
|
||||
SCPrintf(pCon, eStatus, "%s.home = %f\n", name, self->fHome);
|
||||
SCPrintf(pCon, eStatus, "%s.speed = %f\n", name, self->speed);
|
||||
SCPrintf(pCon, eStatus, "%s.maxSpeed = %f\n", name, self->maxSpeed);
|
||||
SCPrintf(pCon, eStatus, "%s.accel = %f\n", name, self->accel);
|
||||
SCPrintf(pCon, eStatus, "%s.maxAccel = %f\n", name, self->maxAccel);
|
||||
SCPrintf(pCon, eStatus, "%s.decel = %f\n", name, self->decel);
|
||||
SCPrintf(pCon, eStatus, "%s.maxDecel = %f\n", name, self->maxDecel);
|
||||
SCPrintf(pCon, eStatus, "%s.motOnDelay = %d\n", name, self->motOnDelay);
|
||||
SCPrintf(pCon, eStatus, "%s.motOffDelay = %d\n", name, self->motOffDelay);
|
||||
SCPrintf(pCon, eStatus, "%s.motorPollFast = %d\n", name, self->motorPollFast);
|
||||
SCPrintf(pCon, eStatus, "%s.motorPollSlow = %d\n", name, self->motorPollSlow);
|
||||
SCPrintf(pCon, eStatus, "%s.airPollTimer = %d\n", name, self->airPollTimer);
|
||||
SCPrintf(pCon, eStatus, "%s.Debug = %d\n", name, self->debug);
|
||||
SCPrintf(pCon, eStatus, "%s.Settle = %d\n", name, self->settle);
|
||||
SCPrintf(pCon, eStatus, "%s.Blockage_Check_Interval = %f\n", name, self->blockage_ckInterval);
|
||||
SCPrintf(pCon, eStatus, "%s.Blockage_Thresh = %f\n", name, self->blockage_thresh);
|
||||
SCPrintf(pCon, eStatus, "%s.Blockage_Ratio = %f\n", name, self->blockage_ratio);
|
||||
SCPrintf(pCon, eStatus, "%s.Blockage_Fail = %d\n", name, self->blockage_fail);
|
||||
SCPrintf(pCon, eStatus, "%s.Backlash_offset = %f\n", name, self->backlash_offset);
|
||||
SCPrintf(pCon, eStatus, "%s.Protocol = %d\n", name, self->protocol);
|
||||
SCPrintf(pCon, eStatus, "%s.absEncoder = %d\n", name, self->abs_encoder);
|
||||
SCPrintf(pCon, eValue, "%s.home = %f\n", name, self->fHome);
|
||||
SCPrintf(pCon, eValue, "%s.speed = %f\n", name, self->speed);
|
||||
SCPrintf(pCon, eValue, "%s.maxSpeed = %f\n", name, self->maxSpeed);
|
||||
SCPrintf(pCon, eValue, "%s.accel = %f\n", name, self->accel);
|
||||
SCPrintf(pCon, eValue, "%s.maxAccel = %f\n", name, self->maxAccel);
|
||||
SCPrintf(pCon, eValue, "%s.decel = %f\n", name, self->decel);
|
||||
SCPrintf(pCon, eValue, "%s.maxDecel = %f\n", name, self->maxDecel);
|
||||
SCPrintf(pCon, eValue, "%s.motOnDelay = %d\n", name, self->motOnDelay);
|
||||
SCPrintf(pCon, eValue, "%s.motOffDelay = %d\n", name, self->motOffDelay);
|
||||
SCPrintf(pCon, eValue, "%s.motorPollFast = %d\n", name, self->motorPollFast);
|
||||
SCPrintf(pCon, eValue, "%s.motorPollSlow = %d\n", name, self->motorPollSlow);
|
||||
SCPrintf(pCon, eValue, "%s.airPollTimer = %d\n", name, self->airPollTimer);
|
||||
SCPrintf(pCon, eValue, "%s.Debug = %d\n", name, self->debug);
|
||||
SCPrintf(pCon, eValue, "%s.Settle = %d\n", name, self->settle);
|
||||
SCPrintf(pCon, eValue, "%s.Blockage_Check_Interval = %f\n", name, self->blockage_ckInterval);
|
||||
SCPrintf(pCon, eValue, "%s.Blockage_Thresh = %f\n", name, self->blockage_thresh);
|
||||
SCPrintf(pCon, eValue, "%s.Blockage_Ratio = %f\n", name, self->blockage_ratio);
|
||||
SCPrintf(pCon, eValue, "%s.Blockage_Fail = %d\n", name, self->blockage_fail);
|
||||
SCPrintf(pCon, eValue, "%s.Backlash_offset = %f\n", name, self->backlash_offset);
|
||||
SCPrintf(pCon, eValue, "%s.Protocol = %d\n", name, self->protocol);
|
||||
SCPrintf(pCon, eValue, "%s.absEncoder = %d\n", name, self->abs_encoder);
|
||||
if (self->abs_encoder) {
|
||||
SCPrintf(pCon, eStatus, "%s.absEncHome = %d\n", name, self->absEncHome);
|
||||
SCPrintf(pCon, eStatus, "%s.cntsPerX = %f\n", name, self->cntsPerX);
|
||||
SCPrintf(pCon, eStatus, "%s.Creep_Offset = %f\n", name, self->creep_offset);
|
||||
SCPrintf(pCon, eStatus, "%s.Creep_Precision = %f\n", name, self->creep_precision);
|
||||
SCPrintf(pCon, eStatus, "%s.Creep_Factor = %f\n", name, self->creep_factor);
|
||||
SCPrintf(pCon, eStatus, "%s.Creep_Substep = %f\n", name, self->creep_substep);
|
||||
SCPrintf(pCon, eValue, "%s.absEncHome = %d\n", name, self->absEncHome);
|
||||
SCPrintf(pCon, eValue, "%s.cntsPerX = %f\n", name, self->cntsPerX);
|
||||
SCPrintf(pCon, eValue, "%s.Creep_Offset = %f\n", name, self->creep_offset);
|
||||
SCPrintf(pCon, eValue, "%s.Creep_Precision = %f\n", name, self->creep_precision);
|
||||
SCPrintf(pCon, eValue, "%s.Creep_Factor = %f\n", name, self->creep_factor);
|
||||
SCPrintf(pCon, eValue, "%s.Creep_Substep = %f\n", name, self->creep_substep);
|
||||
}
|
||||
if (self->posit_count > 0) {
|
||||
int i;
|
||||
SCPrintf(pCon, eStatus, "%s.posit_count = %d\n", name,
|
||||
SCPrintf(pCon, eValue, "%s.posit_count = %d\n", name,
|
||||
self->posit_count);
|
||||
for (i = 0; i < self->posit_count; ++i) {
|
||||
SCPrintf(pCon, eStatus, "%s.posit_%d = %lld\n", name, i + 1,
|
||||
SCPrintf(pCon, eValue, "%s.posit_%d = %lld\n", name, i + 1,
|
||||
posit2count(self, i + 1));
|
||||
}
|
||||
}
|
||||
SCPrintf(pCon, eStatus, "%s.stepsPerX = %f\n", name, self->stepsPerX);
|
||||
SCPrintf(pCon, eValue, "%s.stepsPerX = %f\n", name, self->stepsPerX);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -4904,13 +4904,13 @@ static void DMC_Notify(void* context, int event) {
|
||||
switch (event) {
|
||||
case AQU_DISCONNECT:
|
||||
snprintf(line, 132, "Disconnect on Motor '%s'", self->name);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
/* TODO: disconnect */
|
||||
change_state(self, DMCState_Disconnected);
|
||||
break;
|
||||
case AQU_RECONNECT:
|
||||
snprintf(line, 132, "Reconnect on Motor '%s'", self->name);
|
||||
SICSLogWrite(line, eStatus);
|
||||
SICSLogWrite(line, eLog);
|
||||
/* TODO: reconnect */
|
||||
/* Reset the state machine */
|
||||
DMC_ClearTimer(self);
|
||||
@@ -5376,7 +5376,7 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
strncpy(addr, inet_ntoa(sock->adresse.sin_addr), 80);
|
||||
addr[79] = '\0';
|
||||
snprintf(line, 132, "%s.address = %s:%d\n", self->name, addr, port);
|
||||
SCWrite(pCon, line, eStatus);
|
||||
SCWrite(pCon, line, eValue);
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
@@ -5493,9 +5493,9 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
int iCode;
|
||||
char error[CMDLEN];
|
||||
DMC2280Error(self, &iCode, error, CMDLEN);
|
||||
SCPrintf(pCon, eStatus, "%s.error = %d:%s", self->name, iCode, error);
|
||||
SCPrintf(pCon, eValue, "%s.error = %d:%s", self->name, iCode, error);
|
||||
} else {
|
||||
SCPrintf(pCon, eStatus, "%s.error = %d:%s", self->name, 0, "No error");
|
||||
SCPrintf(pCon, eValue, "%s.error = %d:%s", self->name, 0, "No error");
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
@@ -5580,7 +5580,7 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
return 1;
|
||||
}
|
||||
} else {
|
||||
SCPrintf(pCon, eStatus, "%s.oscillation = %s", self->name, self->doOscillate ? "on" : "off");
|
||||
SCPrintf(pCon, eValue, "%s.oscillation = %s", self->name, self->doOscillate ? "on" : "off");
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
@@ -5778,7 +5778,7 @@ int DMC2280Action(SConnection *pCon, SicsInterp *pSics, void *pData,
|
||||
}
|
||||
}
|
||||
fclose(fp);
|
||||
SCPrintf(pCon, eStatus, "Motor %s, tracking data saved to %s",
|
||||
SCPrintf(pCon, eLog, "Motor %s, tracking data saved to %s",
|
||||
argv[0], rp ? rp : argv[3]);
|
||||
if (rp)
|
||||
free(rp);
|
||||
|
||||
Reference in New Issue
Block a user