Compare commits

...

6 Commits

Author SHA1 Message Date
95bc899114 Added safe limit setter
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 6s
2026-02-10 08:48:25 +01:00
82f509596d Added disconnect handling to sinqMotor 2026-02-10 08:33:03 +01:00
2376e2adfd Roll head back to 1.5.7
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 5s
2026-02-10 08:10:56 +01:00
4e30331c92 Added disconnect handling to sinqMotor
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 6s
2026-01-22 09:52:24 +01:00
2578081814 Added dedicated interface function for setting the operation mode.
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 5s
2026-01-20 16:47:36 +01:00
6f639d7233 Added scaffolding for velocity mode
All checks were successful
Test And Build / Lint (push) Successful in 5s
Test And Build / Build (push) Successful in 5s
Added records to support detection of the current operation mode
(position or velocity), whether one is allowed to change between the two
and a record to actually change between the two. Also added a
doMoveVelocity method which should be implemented by derived drivers if
they support velocity mode.
2026-01-20 14:11:06 +01:00
3 changed files with 173 additions and 0 deletions

125
.gitignore vendored Normal file
View File

@@ -0,0 +1,125 @@
# Took these from the https://github.com/github/gitignore project on October 21, 2011
# **** 'Personal' entries don't belong in here - put them in your .git/info/exclude file ****
# Ignore text editor (e.g. emacs) autosave files
*~
# Build Artifacts
O.*_Common/
O.*_RHEL8-x86_64/
# Compiled Object files
*.slo
*.lo
*.o
*.obj
*.d
SICServer*
# Compiled Dynamic libraries
*.so
# Compiled Static libraries
*.lai
*.la
*.a
# Compiled python files
*.py[co]
# Eclipse-generated files
*.pydevproject
.project
.metadata
bin/**
tmp/**
tmp/**/*
*.tmp
*.bak
*.swp
*~.nib
local.properties
.classpath
.settings/
.loadpath
# External tool builders
.externalToolBuilders/
# Locally stored "Eclipse launch configurations"
*.launch
# CDT-specific
.cproject
# PDT-specific
.buildpath
## Ignore Visual Studio temporary files, build results, and
## files generated by popular Visual Studio add-ons.
*.sln
*.vcproj
*.exe
*.vcxproj
*.filters
# User-specific files
*.suo
*.user
*.sln.docstates
*.sdf
.cvsignore
#Test results
*.log
# Build results
[Dd]ebug/
[Rr]elease/
*_i.c
*_p.c
*.ilk
*.meta
*.obj
*.pch
*.pdb
*.pgc
*.pgd
*.rsp
*.sbr
*.tlb
*.tli
*.tlh
*.tmp
*.vspscc
.builds
# Visual C++ cache files
ipch/
*.aps
*.ncb
*.opensdf
*.sdf
# Visual Studio profiler
*.psess
*.vsp
# ReSharper is a .NET coding add-in
_ReSharper*
# Others
*.autosave
# Windows image file caches
Thumbs.db
# Mac OS X Finder
.DS_Store
._*

View File

@@ -245,6 +245,10 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
// Clear the communication // Clear the communication
setAxisParamChecked(this, motorStatusCommsError, false); setAxisParamChecked(this, motorStatusCommsError, false);
// Assume the motor is initially connected. During the poll, this value will
// be set to false if the motor is not connected.
setAxisParamChecked(this, motorConnected, true);
/* /*
The poll function is just a wrapper around doPoll and handles mainly the The poll function is just a wrapper around doPoll and handles mainly the
callParamCallbacks() function. This wrapper is used to make sure callParamCallbacks() function. This wrapper is used to make sure
@@ -252,6 +256,11 @@ asynStatus sinqAxis::forcedPoll(bool *moving) {
*/ */
poll_status = doPoll(moving); poll_status = doPoll(moving);
// Motor is not connected
if (poll_status == asynDisconnected) {
setAxisParamChecked(this, motorConnected, false);
}
/* /*
If the poll did not succeed OR if an error message is waiting, something If the poll did not succeed OR if an error message is waiting, something
went wrong and the motor has a status problem. Otherwise, delete the error went wrong and the motor has a status problem. Otherwise, delete the error
@@ -484,6 +493,31 @@ asynStatus sinqAxis::setMotorPosition(double motorPos) {
return status; return status;
} }
asynStatus sinqAxis::setLimits(double highLimit, double lowLimit) {
asynStatus status = asynSuccess;
if (highLimit < lowLimit) {
double motorPos;
double motorRecRes;
status = motorPosition(&motorPos);
if (status != asynSuccess) {
return status;
}
getAxisParamChecked(this, motorRecResolution, &motorRecRes);
// This is a safe fallback
setAxisParamChecked(this, motorHighLimitFromDriver,
motorPos + motorRecRes);
setAxisParamChecked(this, motorLowLimitFromDriver,
motorPos - motorRecRes);
} else {
setAxisParamChecked(this, motorHighLimitFromDriver, highLimit);
setAxisParamChecked(this, motorLowLimitFromDriver, lowLimit);
}
return status;
}
asynStatus sinqAxis::assertConnected() { asynStatus sinqAxis::assertConnected() {
int connected = 0; int connected = 0;
getAxisParamChecked(this, motorConnected, &connected); getAxisParamChecked(this, motorConnected, &connected);

View File

@@ -391,6 +391,20 @@ class HIDDEN sinqAxis : public asynMotorAxis {
*/ */
asynStatus setMotorPosition(double motorPosition); asynStatus setMotorPosition(double motorPosition);
/**
* @brief Sanity-check the limits and write them into the database
*
* If the given `highLimit` is smaller than the `lowLimit`, the limits are
* set to `highLimit = motorPosition + motorRecResolution`,
* `lowLimit = motorPosition - motorRecResolution` and a warning is
* displayed in the IOC shell. This is not an error
*
* @param highLimit
* @param lowLimit
* @return asynStatus
*/
asynStatus setLimits(double highLimit, double lowLimit);
/** /**
* @brief Check if the axis is not connected and print a corresponding error * @brief Check if the axis is not connected and print a corresponding error
* message * message