Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0e10bcf69d | |||
| cb4adb068c | |||
| d7c9d009ee |
@@ -5,17 +5,13 @@
|
|||||||
|
|
||||||
msgPrintControlKey::msgPrintControlKey(char *controller, int axisNo,
|
msgPrintControlKey::msgPrintControlKey(char *controller, int axisNo,
|
||||||
const char *functionName, int line,
|
const char *functionName, int line,
|
||||||
size_t maxRepetitions) {
|
size_t maxRepetitions)
|
||||||
controller_ = controller;
|
: controller_(controller), axisNo_(axisNo), functionName_(functionName),
|
||||||
axisNo_ = axisNo;
|
line_(line), maxRepetitions_(maxRepetitions) {}
|
||||||
line_ = line;
|
|
||||||
functionName_ = functionName;
|
|
||||||
maxRepetitions_ = maxRepetitions;
|
|
||||||
}
|
|
||||||
|
|
||||||
void msgPrintControlKey::format(char *buffer, size_t bufferSize) {
|
void msgPrintControlKey::format(char *buffer, size_t bufferSize) {
|
||||||
snprintf(buffer, bufferSize, "controller %s, axis %d, function %s, line %d",
|
snprintf(buffer, bufferSize, "controller %s, axis %d, function %s, line %d",
|
||||||
controller_.c_str(), axisNo_, functionName_, line_);
|
controller_.c_str(), axisNo_, functionName_.c_str(), line_);
|
||||||
}
|
}
|
||||||
|
|
||||||
// =============================================================================
|
// =============================================================================
|
||||||
@@ -78,8 +74,8 @@ bool msgPrintControl::shouldBePrinted(msgPrintControlKey &key, bool wantToPrint,
|
|||||||
pasynUser, ASYN_TRACE_ERROR,
|
pasynUser, ASYN_TRACE_ERROR,
|
||||||
"Controller \"%s\", axis %d => %s, line %d\nError "
|
"Controller \"%s\", axis %d => %s, line %d\nError "
|
||||||
"associated with key \"%s\" has been resolved.\n",
|
"associated with key \"%s\" has been resolved.\n",
|
||||||
key.controller_.c_str(), key.axisNo_, key.functionName_,
|
key.controller_.c_str(), key.axisNo_,
|
||||||
key.line_, formattedKey);
|
key.functionName_.c_str(), key.line_, formattedKey);
|
||||||
}
|
}
|
||||||
map_[key] = 0;
|
map_[key] = 0;
|
||||||
}
|
}
|
||||||
@@ -107,7 +103,7 @@ void msgPrintControl::resetCount(msgPrintControlKey &key, asynUser *pasynUser) {
|
|||||||
"Controller \"%s\", axis %d => %s, line %d\nError "
|
"Controller \"%s\", axis %d => %s, line %d\nError "
|
||||||
"associated with key \"%s\" has been resolved.\n",
|
"associated with key \"%s\" has been resolved.\n",
|
||||||
key.controller_.c_str(), key.axisNo_,
|
key.controller_.c_str(), key.axisNo_,
|
||||||
key.functionName_, key.line_, formattedKey);
|
key.functionName_.c_str(), key.line_, formattedKey);
|
||||||
}
|
}
|
||||||
map_[key] = 0;
|
map_[key] = 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class HIDDEN msgPrintControlKey {
|
|||||||
// -1 indicates a non-axis specific message
|
// -1 indicates a non-axis specific message
|
||||||
int axisNo_;
|
int axisNo_;
|
||||||
|
|
||||||
const char *functionName_;
|
std::string functionName_;
|
||||||
int line_;
|
int line_;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -38,7 +38,7 @@ class HIDDEN msgPrintControlKey {
|
|||||||
|
|
||||||
bool operator==(const msgPrintControlKey &other) const {
|
bool operator==(const msgPrintControlKey &other) const {
|
||||||
return axisNo_ == other.axisNo_ && line_ == other.line_ &&
|
return axisNo_ == other.axisNo_ && line_ == other.line_ &&
|
||||||
strcmp(functionName_, other.functionName_) == 0 &&
|
functionName_ == other.functionName_ &&
|
||||||
controller_ == other.controller_;
|
controller_ == other.controller_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -55,7 +55,7 @@ template <> struct hash<msgPrintControlKey> {
|
|||||||
// Combine the hashes of the members (x and y)
|
// Combine the hashes of the members (x and y)
|
||||||
size_t h1 = std::hash<std::string>{}(obj.controller_);
|
size_t h1 = std::hash<std::string>{}(obj.controller_);
|
||||||
size_t h2 = hash<int>{}(obj.axisNo_);
|
size_t h2 = hash<int>{}(obj.axisNo_);
|
||||||
size_t h3 = std::hash<const char *>{}(obj.functionName_);
|
size_t h3 = std::hash<std::string>{}(obj.functionName_);
|
||||||
size_t h4 = hash<int>{}(obj.line_);
|
size_t h4 = hash<int>{}(obj.line_);
|
||||||
// Combine the hashes (simple XOR and shifting technique)
|
// Combine the hashes (simple XOR and shifting technique)
|
||||||
return h1 ^ (h2 << 1) ^ (h3 << 2) ^ (h4 << 3);
|
return h1 ^ (h2 << 1) ^ (h3 << 2) ^ (h4 << 3);
|
||||||
|
|||||||
@@ -318,7 +318,12 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
|
|||||||
return poll_status;
|
return poll_status;
|
||||||
}
|
}
|
||||||
|
|
||||||
asynStatus sinqAxis::doPoll(bool * /*moving*/) { return asynSuccess; }
|
asynStatus sinqAxis::doPoll(bool *moving) {
|
||||||
|
// Suppress unused variable warning - this is just a default fallback
|
||||||
|
// function.
|
||||||
|
(void)moving;
|
||||||
|
return asynSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
asynStatus sinqAxis::move(double position, int relative, double minVelocity,
|
asynStatus sinqAxis::move(double position, int relative, double minVelocity,
|
||||||
double maxVelocity, double acceleration) {
|
double maxVelocity, double acceleration) {
|
||||||
@@ -354,9 +359,15 @@ asynStatus sinqAxis::move(double position, int relative, double minVelocity,
|
|||||||
return pC_->callParamCallbacks();
|
return pC_->callParamCallbacks();
|
||||||
}
|
}
|
||||||
|
|
||||||
asynStatus sinqAxis::doMove(double /*position*/, int /*relative*/,
|
asynStatus sinqAxis::doMove(double position, int relative, double minVelocity,
|
||||||
double /*minVelocity*/, double /*maxVelocity*/,
|
double maxVelocity, double acceleration) {
|
||||||
double /*acceleration*/) {
|
// Suppress unused variable warning - this is just a default fallback
|
||||||
|
// function.
|
||||||
|
(void)position;
|
||||||
|
(void)relative;
|
||||||
|
(void)minVelocity;
|
||||||
|
(void)maxVelocity;
|
||||||
|
(void)acceleration;
|
||||||
return asynSuccess;
|
return asynSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -398,8 +409,14 @@ asynStatus sinqAxis::home(double minVelocity, double maxVelocity,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
asynStatus sinqAxis::doHome(double /*minVelocity*/, double /*maxVelocity*/,
|
asynStatus sinqAxis::doHome(double minVelocity, double maxVelocity,
|
||||||
double /*acceleration*/, int /*forwards*/) {
|
double acceleration, int forwards) {
|
||||||
|
// Suppress unused variable warning - this is just a default fallback
|
||||||
|
// function.
|
||||||
|
(void)minVelocity;
|
||||||
|
(void)maxVelocity;
|
||||||
|
(void)acceleration;
|
||||||
|
(void)forwards;
|
||||||
return asynSuccess;
|
return asynSuccess;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -421,7 +438,12 @@ asynStatus sinqAxis::reset() {
|
|||||||
|
|
||||||
asynStatus sinqAxis::doReset() { return asynError; }
|
asynStatus sinqAxis::doReset() { return asynError; }
|
||||||
|
|
||||||
asynStatus sinqAxis::enable(bool /*on*/) { return asynSuccess; }
|
asynStatus sinqAxis::enable(bool on) {
|
||||||
|
// Suppress unused variable warning - this is just a default fallback
|
||||||
|
// function.
|
||||||
|
(void)on;
|
||||||
|
return asynSuccess;
|
||||||
|
}
|
||||||
|
|
||||||
asynStatus sinqAxis::motorPosition(double *motorPos) {
|
asynStatus sinqAxis::motorPosition(double *motorPos) {
|
||||||
asynStatus status = asynSuccess;
|
asynStatus status = asynSuccess;
|
||||||
|
|||||||
@@ -32,6 +32,13 @@ class HIDDEN sinqAxis : public asynMotorAxis {
|
|||||||
*/
|
*/
|
||||||
~sinqAxis();
|
~sinqAxis();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Delete the copy and copy assignment constructors, because this
|
||||||
|
* class should not be copied (it is tied to hardware!)
|
||||||
|
*/
|
||||||
|
sinqAxis(const sinqAxis &) = delete;
|
||||||
|
sinqAxis &operator=(const sinqAxis &) = delete;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Check if a poll should be performed. If yes, call `forcedPoll`.
|
* @brief Check if a poll should be performed. If yes, call `forcedPoll`.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -58,6 +58,13 @@ class HIDDEN sinqController : public asynMotorController {
|
|||||||
*/
|
*/
|
||||||
virtual ~sinqController(void);
|
virtual ~sinqController(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Delete the copy and copy assignment constructors, because this
|
||||||
|
* class should not be copied (it is tied to hardware!)
|
||||||
|
*/
|
||||||
|
sinqController(const sinqController &) = delete;
|
||||||
|
sinqController &operator=(const sinqController &) = delete;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Overloaded function of asynMotorController
|
* @brief Overloaded function of asynMotorController
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user