Cleaned up ANSTO code to merge with sinqdev.sics

This is our new RELEASE-4_0 branch which was taken from ansto/93d9a7c
Conflicts:
	.gitignore
	SICSmain.c
	asynnet.c
	confvirtualmot.c
	counter.c
	devexec.c
	drive.c
	event.h
	exebuf.c
	exeman.c
	histmem.c
	interface.h
	motor.c
	motorlist.c
	motorsec.c
	multicounter.c
	napi.c
	napi.h
	napi4.c
	network.c
	nwatch.c
	nxscript.c
	nxxml.c
	nxxml.h
	ofac.c
	reflist.c
	scan.c
	sicshipadaba.c
	sicsobj.c
	site_ansto/docs/Copyright.txt
	site_ansto/instrument/lyrebird/config/tasmad/sicscommon/nxsupport.tcl
	site_ansto/instrument/lyrebird/config/tasmad/taspub_sics/tasscript.tcl
	statusfile.c
	tasdrive.c
	tasub.c
	tasub.h
	tasublib.c
	tasublib.h
This commit is contained in:
Ferdi Franceschini
2015-04-23 20:49:26 +10:00
parent c650788a2c
commit 10d29d597c
1336 changed files with 9430 additions and 226646 deletions

View File

@@ -10,6 +10,10 @@
Heavily reworked to fit into the new four circle system
Mark Koennecke, July 2008
Added UBfromCell
Mark Koennecke, March 2013
-----------------------------------------------------------------------*/
#include <stdlib.h>
#include <assert.h>
@@ -252,7 +256,39 @@ static int calcUB(pUBCALC self, SConnection * pCon, char *ref1, char *ref2)
return 1;
}
}
/*---------------------------------------------------------------------*/
static int UBFromCell(pUBCALC self, SConnection *pCon)
{
const double *cell;
lattice mycell;
MATRIX B;
double ub[9];
int i;
cell = SXGetCell();
mycell.a = cell[0];
mycell.b = cell[1];
mycell.c = cell[2];
mycell.alpha = cell[3];
mycell.beta = cell[4];
mycell.gamma = cell[5];
B = mat_creat(3,3,ZERO_MATRIX);
if(B == NULL){
SCWrite(pCon,"ERROR: out of memory in UBfromCell",eError);
return 0;
}
calculateBMatrix(mycell,B);
if(self->UB != NULL){
mat_free(self->UB);
}
self->UB = B;
SCSendOK(pCon);
return 1;
}
/*---------------------------------------------------------------------*/
static int sendUBToHKL(SConnection * pCon, SicsInterp * pSics,
pHKL hkl, MATRIX UB)
@@ -551,6 +587,8 @@ int UBCalcWrapper(SConnection * pCon, SicsInterp * pSics, void *pData,
return sendUBToHKL(pCon, pSics, self->hkl, self->UB);
} else if (strcmp(argv[1], "index") == 0) {
return findIndex(self, pCon, pSics, argc, argv);
} else if (strcmp(argv[1], "fromcell") == 0) {
return UBFromCell(self, pCon);
} else {
if (argc > 2) {
return setUBCalcParameters(self, pCon, argv[1], argv[2]);