- Added hmslave.c

- Tasub only drives required motors
- Tasub handles fixed motors more gracefully
This commit is contained in:
koennecke
2007-05-30 11:57:50 +00:00
parent 55893f9133
commit 9737722b8c
9 changed files with 355 additions and 6 deletions

View File

@ -4,6 +4,9 @@
copyright: see file COPYRIGHT
Mark Koennecke, May 2005
In the long run it might be useful to switch all this to the more
general motor list driving code.
--------------------------------------------------------------------*/
#include <assert.h>
#include "sics.h"
@ -248,6 +251,7 @@ static int startMotors(ptasMot self, tasAngles angles,
int status, silent;
silent = self->math->silent;
self->math->mustRecalculate = 1;
/*
monochromator
*/
@ -472,13 +476,23 @@ static int calculateAndDrive(ptasMot self, SConnection *pCon){
/*-----------------------------------------------------------------------------*/
static int checkMotors(ptasMot self, SConnection *pCon){
int i, status, length = 12;
int mask[12];
self->math->mustRecalculate = 1;
if(self->math->tasMode == ELASTIC){
length = 8;
}
memset(mask,0,12*sizeof(int));
for(i = 0; i < length; i++){
mask[i] = 1;
}
if(self->math->outOfPlaneAllowed != 0){
mask[SGU] = 0;
mask[SGL] = 0;
}
for(i = 0; i < 12; i++){
if(self->math->motors[i] != NULL){
if(self->math->motors[i] != NULL && mask[i] != 0){
status = self->math->motors[i]->pDrivInt->CheckStatus(self->math->motors[i],
pCon);
if(status != HWIdle && status != OKOK){