Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6d46b3ac0c | |||
| ed0525e811 |
@@ -21,9 +21,6 @@ TEMPLATES += sinqEPICSApp/Db/el734.db
|
|||||||
# DBD files to include in the release
|
# DBD files to include in the release
|
||||||
DBDS += sinqEPICSApp/src/sinq.dbd
|
DBDS += sinqEPICSApp/src/sinq.dbd
|
||||||
|
|
||||||
# Release version
|
|
||||||
LIBVERSION=2026
|
|
||||||
|
|
||||||
# Source files to build
|
# Source files to build
|
||||||
SOURCES += sinqEPICSApp/src/devScalerEL737.c
|
SOURCES += sinqEPICSApp/src/devScalerEL737.c
|
||||||
SOURCES += sinqEPICSApp/src/SINQController.cpp
|
SOURCES += sinqEPICSApp/src/SINQController.cpp
|
||||||
|
|||||||
@@ -505,10 +505,7 @@ asynStatus EL734Axis::poll(bool *moving)
|
|||||||
// errlogPrintf("Axis %d, reply %s, msr %d, oredmsr = %d, position = %lf\n",
|
// errlogPrintf("Axis %d, reply %s, msr %d, oredmsr = %d, position = %lf\n",
|
||||||
// axisNo_, reply, msr, oredMSR, position);
|
// axisNo_, reply, msr, oredMSR, position);
|
||||||
|
|
||||||
// Reset the error during each poll. This is necessary because some errors
|
oredMSR |= msr;
|
||||||
// apparently don't get cleared by the controller (especially "lower / higher
|
|
||||||
// limit hit").
|
|
||||||
oredMSR = msr;
|
|
||||||
if ((msr & 0x1) == 0)
|
if ((msr & 0x1) == 0)
|
||||||
{
|
{
|
||||||
// done: check for trouble
|
// done: check for trouble
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ January 2019
|
|||||||
#include "PhytronDriver.h"
|
#include "PhytronDriver.h"
|
||||||
#include <epicsExport.h>
|
#include <epicsExport.h>
|
||||||
|
|
||||||
#define IDLEPOLL 60
|
#define IDLEPOLL 5
|
||||||
|
|
||||||
/** Creates a new PhytronController object.
|
/** Creates a new PhytronController object.
|
||||||
* \param[in] portName The name of the asyn port that will be created for this driver
|
* \param[in] portName The name of the asyn port that will be created for this driver
|
||||||
@@ -56,7 +56,7 @@ January 2019
|
|||||||
* \param[in] numAxes The number of axes that this controller supports
|
* \param[in] numAxes The number of axes that this controller supports
|
||||||
*/
|
*/
|
||||||
PhytronController::PhytronController(const char *portName, const char *PhytronPortName, const char *sel ,
|
PhytronController::PhytronController(const char *portName, const char *PhytronPortName, const char *sel ,
|
||||||
int encX, int encY)
|
int encX, int encY, int ignoreLimitsX, int ignoreLimitsY)
|
||||||
: SINQController(portName, PhytronPortName,2)
|
: SINQController(portName, PhytronPortName,2)
|
||||||
{
|
{
|
||||||
asynStatus status;
|
asynStatus status;
|
||||||
@@ -82,8 +82,8 @@ PhytronController::PhytronController(const char *portName, const char *PhytronPo
|
|||||||
new PhytronDoseAxis(this, 1, encX);
|
new PhytronDoseAxis(this, 1, encX);
|
||||||
new PhytronDoseAxis(this, 2, encY);
|
new PhytronDoseAxis(this, 2, encY);
|
||||||
} else {
|
} else {
|
||||||
new PhytronAxis(this, 1, encX);
|
new PhytronAxis(this, 1, encX, ignoreLimitsX);
|
||||||
new PhytronAxis(this, 2, encY);
|
new PhytronAxis(this, 2, encY, ignoreLimitsY);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -92,7 +92,7 @@ PhytronController::PhytronController(const char *portName, const char *PhytronPo
|
|||||||
|
|
||||||
PhytronDoseController::PhytronDoseController(const char *portName, const char *PhytronPortName, const char *sel ,
|
PhytronDoseController::PhytronDoseController(const char *portName, const char *PhytronPortName, const char *sel ,
|
||||||
int encX, int encY)
|
int encX, int encY)
|
||||||
: PhytronController(portName, PhytronPortName, sel, encX, encY)
|
: PhytronController(portName, PhytronPortName, sel, encX, encY, 0, 0)
|
||||||
{
|
{
|
||||||
new PhytronDoseAxis(this, 1, encX);
|
new PhytronDoseAxis(this, 1, encX);
|
||||||
new PhytronDoseAxis(this, 2, encY);
|
new PhytronDoseAxis(this, 2, encY);
|
||||||
@@ -106,9 +106,9 @@ PhytronDoseController::PhytronDoseController(const char *portName, const char *P
|
|||||||
* \param[in] numAxes The number of axes that this controller supports
|
* \param[in] numAxes The number of axes that this controller supports
|
||||||
*/
|
*/
|
||||||
extern "C" int PhytronCreateController(const char *portName, const char *PhytronPortName, const char *selector,
|
extern "C" int PhytronCreateController(const char *portName, const char *PhytronPortName, const char *selector,
|
||||||
int encX, int encY)
|
int encX, int encY, int ignoreLimitsX, int ignoreLimitsY)
|
||||||
{
|
{
|
||||||
new PhytronController(portName, PhytronPortName,selector, encX, encY);
|
new PhytronController(portName, PhytronPortName,selector, encX, encY, ignoreLimitsX, ignoreLimitsY);
|
||||||
return(asynSuccess);
|
return(asynSuccess);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -178,10 +178,10 @@ PhytronDoseAxis* PhytronDoseController::getAxis(int axisNo)
|
|||||||
|
|
||||||
asynStatus PhytronController::transactController(int axisNo,char command[COMLEN], char reply[COMLEN])
|
asynStatus PhytronController::transactController(int axisNo,char command[COMLEN], char reply[COMLEN])
|
||||||
{
|
{
|
||||||
asynStatus status;
|
asynStatus status = asynSuccess;
|
||||||
size_t in, out;
|
size_t in = 0, out = 0;
|
||||||
int reason;
|
int reason = 0;
|
||||||
char myReply[COMLEN+10], myCommand[COMLEN+10], *pPtr;
|
char myReply[COMLEN+10] = {0}, myCommand[COMLEN+10] = {0}, *pPtr = {0};
|
||||||
SINQAxis *axis = getAxis(axisNo);
|
SINQAxis *axis = getAxis(axisNo);
|
||||||
|
|
||||||
|
|
||||||
@@ -237,11 +237,12 @@ asynStatus PhytronController::transactController(int axisNo,char command[COMLEN]
|
|||||||
*
|
*
|
||||||
* Initializes register numbers, etc.
|
* Initializes register numbers, etc.
|
||||||
*/
|
*/
|
||||||
PhytronAxis::PhytronAxis(PhytronController *pC, int axisNo, int enc)
|
PhytronAxis::PhytronAxis(PhytronController *pC, int axisNo, int enc, int ignoreLimits)
|
||||||
: SINQAxis(pC, axisNo),
|
: SINQAxis(pC, axisNo),
|
||||||
pC_(pC)
|
pC_(pC)
|
||||||
{
|
{
|
||||||
encoder = enc;
|
encoder = enc;
|
||||||
|
ignore_limits = ignoreLimits;
|
||||||
if(axisNo == 1){
|
if(axisNo == 1){
|
||||||
phytronChar = 'X';
|
phytronChar = 'X';
|
||||||
} else {
|
} else {
|
||||||
@@ -436,8 +437,9 @@ asynStatus PhytronAxis::setPosition(double position)
|
|||||||
|
|
||||||
errlogPrintf("PhytronAxis::setPosition called with %lf\n", position);
|
errlogPrintf("PhytronAxis::setPosition called with %lf\n", position);
|
||||||
|
|
||||||
sprintf(command, "%s%cP22S%f", pC_->selector,phytronChar, position/1000.);
|
// writing encoder register is wrong
|
||||||
status = pC_->transactController(axisNo_,command,reply);
|
//sprintf(command, "%s%cP22S%f", pC_->selector,phytronChar, position/1000.);
|
||||||
|
//status = pC_->transactController(axisNo_,command,reply);
|
||||||
sprintf(command, "%s%cP20S%f", pC_->selector,phytronChar, position/1000.);
|
sprintf(command, "%s%cP20S%f", pC_->selector,phytronChar, position/1000.);
|
||||||
status = pC_->transactController(axisNo_,command,reply);
|
status = pC_->transactController(axisNo_,command,reply);
|
||||||
next_poll = -1;
|
next_poll = -1;
|
||||||
@@ -467,8 +469,6 @@ asynStatus PhytronAxis::poll(bool *moving)
|
|||||||
{
|
{
|
||||||
asynStatus comStatus = asynSuccess;
|
asynStatus comStatus = asynSuccess;
|
||||||
char command[COMLEN], reply[COMLEN];
|
char command[COMLEN], reply[COMLEN];
|
||||||
double lowlim;
|
|
||||||
|
|
||||||
|
|
||||||
// protect against excessive polling
|
// protect against excessive polling
|
||||||
if(time(NULL) < next_poll){
|
if(time(NULL) < next_poll){
|
||||||
@@ -538,13 +538,7 @@ asynStatus PhytronAxis::poll(bool *moving)
|
|||||||
|
|
||||||
if(!*moving) {
|
if(!*moving) {
|
||||||
if(homing){
|
if(homing){
|
||||||
if(homing_direction) {
|
setIntegerParam(pC_->motorStatusAtHome_, true);
|
||||||
pC_->getDoubleParam(axisNo_,pC_->motorHighLimit_,&lowlim);
|
|
||||||
} else {
|
|
||||||
pC_->getDoubleParam(axisNo_,pC_->motorLowLimit_,&lowlim);
|
|
||||||
}
|
|
||||||
setPosition(lowlim);
|
|
||||||
setIntegerParam(pC_->motorStatusAtHome_, true);
|
|
||||||
} else {
|
} else {
|
||||||
/*
|
/*
|
||||||
check limits and errors, upper
|
check limits and errors, upper
|
||||||
@@ -556,7 +550,7 @@ asynStatus PhytronAxis::poll(bool *moving)
|
|||||||
updateMsgTxtFromDriver("No connection to phytron controller");
|
updateMsgTxtFromDriver("No connection to phytron controller");
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
if(strstr(reply,"ACKE") != NULL){
|
if(strstr(reply,"ACKE") != NULL && ignore_limits == 0){
|
||||||
setIntegerParam(pC_->motorStatusHighLimit_, true);
|
setIntegerParam(pC_->motorStatusHighLimit_, true);
|
||||||
updateMsgTxtFromDriver("Hit High Limit");
|
updateMsgTxtFromDriver("Hit High Limit");
|
||||||
comStatus = asynError;
|
comStatus = asynError;
|
||||||
@@ -575,7 +569,7 @@ asynStatus PhytronAxis::poll(bool *moving)
|
|||||||
updateMsgTxtFromDriver("No connection to phytron controller");
|
updateMsgTxtFromDriver("No connection to phytron controller");
|
||||||
goto skip;
|
goto skip;
|
||||||
}
|
}
|
||||||
if(strstr(reply,"ACKE") != NULL){
|
if(strstr(reply,"ACKE") != NULL && ignore_limits == 0){
|
||||||
setIntegerParam(pC_->motorStatusLowLimit_, true);
|
setIntegerParam(pC_->motorStatusLowLimit_, true);
|
||||||
updateMsgTxtFromDriver("Low Limit Hit");
|
updateMsgTxtFromDriver("Low Limit Hit");
|
||||||
comStatus = asynError;
|
comStatus = asynError;
|
||||||
@@ -616,7 +610,7 @@ asynStatus PhytronAxis::poll(bool *moving)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
PhytronDoseAxis::PhytronDoseAxis(PhytronController *pC, int axisNo, int enc)
|
PhytronDoseAxis::PhytronDoseAxis(PhytronController *pC, int axisNo, int enc)
|
||||||
: PhytronAxis(pC, axisNo, enc)
|
: PhytronAxis(pC, axisNo, enc, 0)
|
||||||
{
|
{
|
||||||
if(axisNo == 1){
|
if(axisNo == 1){
|
||||||
doseChar = '3';
|
doseChar = '3';
|
||||||
@@ -720,15 +714,19 @@ static const iocshArg PhytronCreateControllerArg1 = {"Phytron port name", iocshA
|
|||||||
static const iocshArg PhytronCreateControllerArg2 = {"Phytron Selector", iocshArgString};
|
static const iocshArg PhytronCreateControllerArg2 = {"Phytron Selector", iocshArgString};
|
||||||
static const iocshArg PhytronCreateControllerArg3 = {"EncoderX", iocshArgInt};
|
static const iocshArg PhytronCreateControllerArg3 = {"EncoderX", iocshArgInt};
|
||||||
static const iocshArg PhytronCreateControllerArg4 = {"EncoderY", iocshArgInt};
|
static const iocshArg PhytronCreateControllerArg4 = {"EncoderY", iocshArgInt};
|
||||||
|
static const iocshArg PhytronCreateControllerArg5 = {"IgnoreLimitsX", iocshArgInt};
|
||||||
|
static const iocshArg PhytronCreateControllerArg6 = {"IgnoreLimitsY", iocshArgInt};
|
||||||
static const iocshArg * const PhytronCreateControllerArgs[] = {&PhytronCreateControllerArg0,
|
static const iocshArg * const PhytronCreateControllerArgs[] = {&PhytronCreateControllerArg0,
|
||||||
&PhytronCreateControllerArg1,
|
&PhytronCreateControllerArg1,
|
||||||
&PhytronCreateControllerArg2,
|
&PhytronCreateControllerArg2,
|
||||||
&PhytronCreateControllerArg3,
|
&PhytronCreateControllerArg3,
|
||||||
&PhytronCreateControllerArg4};
|
&PhytronCreateControllerArg4,
|
||||||
static const iocshFuncDef PhytronCreateControllerDef = {"PhytronCreateController", 5, PhytronCreateControllerArgs};
|
&PhytronCreateControllerArg5,
|
||||||
|
&PhytronCreateControllerArg6};
|
||||||
|
static const iocshFuncDef PhytronCreateControllerDef = {"PhytronCreateController", 7, PhytronCreateControllerArgs};
|
||||||
static void PhytronCreateContollerCallFunc(const iocshArgBuf *args)
|
static void PhytronCreateContollerCallFunc(const iocshArgBuf *args)
|
||||||
{
|
{
|
||||||
PhytronCreateController(args[0].sval, args[1].sval, args[2].sval, args[3].ival,args[4].ival);
|
PhytronCreateController(args[0].sval, args[1].sval, args[2].sval, args[3].ival,args[4].ival, args[5].ival, args[6].ival);
|
||||||
}
|
}
|
||||||
|
|
||||||
static const iocshArg PhytronDoseCreateControllerArg0 = {"Port name", iocshArgString};
|
static const iocshArg PhytronDoseCreateControllerArg0 = {"Port name", iocshArgString};
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ class PhytronAxis : public SINQAxis
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
/* These are the methods we override from the base class */
|
/* These are the methods we override from the base class */
|
||||||
PhytronAxis(class PhytronController *pC, int axis, int enc);
|
PhytronAxis(class PhytronController *pC, int axis, int enc, int ignoreLimits);
|
||||||
void report(FILE *fp, int level);
|
void report(FILE *fp, int level);
|
||||||
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration);
|
asynStatus move(double position, int relative, double min_velocity, double max_velocity, double acceleration);
|
||||||
asynStatus moveVelocity(double min_velocity, double max_velocity, double acceleration);
|
asynStatus moveVelocity(double min_velocity, double max_velocity, double acceleration);
|
||||||
@@ -50,6 +50,7 @@ protected:
|
|||||||
int homing_direction; /*1 forward, 0 backwards */
|
int homing_direction; /*1 forward, 0 backwards */
|
||||||
time_t next_poll;
|
time_t next_poll;
|
||||||
int encoder;
|
int encoder;
|
||||||
|
int ignore_limits;
|
||||||
int haveBrake;
|
int haveBrake;
|
||||||
int brakeIO;
|
int brakeIO;
|
||||||
|
|
||||||
@@ -74,7 +75,7 @@ PhytronDoseController *pC_;
|
|||||||
class PhytronController : public SINQController {
|
class PhytronController : public SINQController {
|
||||||
public:
|
public:
|
||||||
PhytronController(const char *portName, const char *PhytronPortName, const char *selector,
|
PhytronController(const char *portName, const char *PhytronPortName, const char *selector,
|
||||||
int encX, int encY);
|
int encX, int encY, int ignoreLimitsX, int ignoreLimitsY);
|
||||||
|
|
||||||
void report(FILE *fp, int level);
|
void report(FILE *fp, int level);
|
||||||
PhytronAxis* getAxis(asynUser *pasynUser);
|
PhytronAxis* getAxis(asynUser *pasynUser);
|
||||||
|
|||||||
@@ -1,162 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
set -euo pipefail
|
|
||||||
IFS=$'\n\t'
|
|
||||||
|
|
||||||
################################################################################
|
|
||||||
# This converts the hex form of a wireshark analysis follow to something
|
|
||||||
# more human readable.
|
|
||||||
#
|
|
||||||
# It is only partially implemented!
|
|
||||||
################################################################################
|
|
||||||
|
|
||||||
f_name="${1}"
|
|
||||||
|
|
||||||
if [ "$#" -eq 2 ]; then
|
|
||||||
filt="${2}"
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
declare -A POSITION_MODE
|
|
||||||
POSITION_MODE[1]="RELATIVE"
|
|
||||||
POSITION_MODE[2]="ABSOLUTE"
|
|
||||||
POSITION_MODE[3]="INTERNAL_REFERANCE"
|
|
||||||
POSITION_MODE[4]="EXTERNAL_REFERANCE"
|
|
||||||
|
|
||||||
|
|
||||||
declare -A COMMANDS
|
|
||||||
|
|
||||||
function to_ord() {
|
|
||||||
printf "%x" "'$1"
|
|
||||||
}
|
|
||||||
|
|
||||||
function add_char() {
|
|
||||||
COMMANDS["$(to_ord "$1")"]="$2"
|
|
||||||
}
|
|
||||||
|
|
||||||
function add_ord() {
|
|
||||||
COMMANDS["$1"]="$2"
|
|
||||||
}
|
|
||||||
|
|
||||||
add_char A Start_Movement
|
|
||||||
add_char C Get_Position
|
|
||||||
add_char D Set_Position_And_Clear_Error
|
|
||||||
add_char d Set_Direction
|
|
||||||
add_char p Set_Position_Mode
|
|
||||||
add_char '$' Get_Status
|
|
||||||
add_char 0 0
|
|
||||||
add_char 1 1
|
|
||||||
add_char 2 2
|
|
||||||
add_char 3 3
|
|
||||||
add_char 4 4
|
|
||||||
add_char 5 5
|
|
||||||
add_char 6 6
|
|
||||||
add_char 7 7
|
|
||||||
add_char 8 8
|
|
||||||
add_char 9 9
|
|
||||||
add_char '#' '#'
|
|
||||||
add_ord 00 ''
|
|
||||||
add_ord 0d '' # '\r'
|
|
||||||
add_ord 2b '+'
|
|
||||||
add_ord 2d '-'
|
|
||||||
|
|
||||||
while read -r line; do
|
|
||||||
fields="$( echo "${line}" | sed -e 's/^ *//' -e 's/ /:/' -e 's/ /:/' | tr -s ' ' )"
|
|
||||||
IFS=' ' bytes=($( echo "${fields}" | cut -d':' -f2))
|
|
||||||
string="$( echo "${fields}" | cut -d':' -f3)"
|
|
||||||
|
|
||||||
parsing_number=-1
|
|
||||||
num_len=0
|
|
||||||
is_negative=0
|
|
||||||
human_readable=()
|
|
||||||
for byte in "${bytes[@]}"; do
|
|
||||||
if [[ -v COMMANDS["${byte}"] ]]; then
|
|
||||||
|
|
||||||
if [[ "${COMMANDS["${byte}"]}" == Get_Status ]] || [[ "${COMMANDS["${byte}"]}" == Get_Position ]] || [[ "${COMMANDS["${byte}"]}" == Set_Position_Mode ]] || [[ "${COMMANDS["${byte}"]}" == Set_Position_And_Clear_Error ]]; then
|
|
||||||
parsing_number=0
|
|
||||||
numlen=0
|
|
||||||
is_negative=0
|
|
||||||
elif [[ "${parsing_number}" -ge 0 ]] && ( [[ "${byte}" == 00 ]] || [[ "${byte}" == 0d ]] ); then
|
|
||||||
if [[ "${num_len}" -ge 1 ]]; then
|
|
||||||
|
|
||||||
if [[ "${human_readable[${#human_readable[@]}-1]}" == Get_Status ]]; then
|
|
||||||
if [[ "$(( parsing_number & 2#0001 ))" -eq 1 ]]; then
|
|
||||||
human_readable=("${human_readable[@]}" "READY")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$(( parsing_number & 2#0010 ))" -eq 1 ]]; then
|
|
||||||
human_readable=("${human_readable[@]}" "ZERO-POS_REACHED")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$(( parsing_number & 2#0100 ))" -eq 1 ]]; then
|
|
||||||
human_readable=("${human_readable[@]}" "POSITIONING_ERROR")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ "$(( parsing_number & 2#1000 ))" -eq 1 ]]; then
|
|
||||||
human_readable=("${human_readable[@]}" "SOMETHING?")
|
|
||||||
fi
|
|
||||||
|
|
||||||
elif [[ "${human_readable[${#human_readable[@]}-1]}" == Set_Position_Mode ]]; then
|
|
||||||
human_readable=("${human_readable[@]}" "${POSITION_MODE[${parsing_number}]}")
|
|
||||||
|
|
||||||
else
|
|
||||||
if [[ "${is_negative}" -eq 1 ]]; then
|
|
||||||
human_readable=("${human_readable[@]}" "$(( parsing_number * -1))")
|
|
||||||
else
|
|
||||||
human_readable=("${human_readable[@]}" "${parsing_number}")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
parsing_number=-1
|
|
||||||
continue
|
|
||||||
elif [ "${parsing_number}" -ge 0 ]; then
|
|
||||||
if [[ "${COMMANDS["${byte}"]}" == '-' ]]; then
|
|
||||||
is_negative=1
|
|
||||||
elif [[ "${COMMANDS["${byte}"]}" == '+' ]]; then
|
|
||||||
is_negative=0
|
|
||||||
else
|
|
||||||
parsing_number="$(( parsing_number * 10 + "${COMMANDS["${byte}"]}" ))"
|
|
||||||
fi
|
|
||||||
|
|
||||||
num_len=$(( num_len + 1 ))
|
|
||||||
continue
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "${#human_readable[@]}" -gt 0 ]; then
|
|
||||||
human_readable=("${human_readable[@]}" "${COMMANDS["${byte}"]}")
|
|
||||||
else
|
|
||||||
human_readable=("${COMMANDS["${byte}"]}")
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
if [ "${#human_readable[@]}" -gt 0 ]; then
|
|
||||||
human_readable=("${human_readable[@]}" "${byte}(unknown)")
|
|
||||||
else
|
|
||||||
human_readable=("${byte}(unknown)")
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
if [[ "${human_readable[0]}" == '#' ]]; then
|
|
||||||
if [[ -z "${filt+x}" ]]; then
|
|
||||||
echo "Sent: ${human_readable[@]}"
|
|
||||||
else
|
|
||||||
if [[ "${human_readable[1]}" == "${filt}" ]]; then
|
|
||||||
echo "Sent: ${human_readable[@]}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
# Some commands prefix the response with two 0's (I assume there can be
|
|
||||||
# more axes)
|
|
||||||
if [[ "${human_readable[0]}" == 0 ]] && [[ "${human_readable[1]}" == 0 ]]; then
|
|
||||||
IFS=' ' human_readable=("${human_readable[@]:2}")
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ -z "${filt+x}" ]]; then
|
|
||||||
echo "Received: ${human_readable[@]}"
|
|
||||||
else
|
|
||||||
if [[ "${human_readable[0]}" == "${filt}" ]]; then
|
|
||||||
echo "Received: ${human_readable[@]}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
done < "${f_name}"
|
|
||||||
Reference in New Issue
Block a user