- Added reflection generation for symmetriqally missing reflections

to fourmess
- Fixed hdbtable, reflist and tasub up to work with GTSE
- Made TRICS do fast scans again
- Added support for SANS beam center calculations
- Fixed a bug where SICS apparently did double counting but in fact
  just omitted an error message and did not
- Added the harray command
This commit is contained in:
koennecke
2009-08-13 07:28:44 +00:00
parent eb5025ab3b
commit 98009be4c3
22 changed files with 653 additions and 80 deletions

View File

@@ -3012,7 +3012,76 @@ static int LinkHdbNode(SConnection * pCon, SicsInterp * pSics, void *pData,
SCSendOK(pCon);
return 1;
}
/*-------------------------------------------------------------------------*/
static int isArrayNode(pHdb node)
{
switch(node->value.dataType) {
case HIPINTAR:
case HIPFLOATAR:
case HIPINTVARAR:
case HIPFLOATVARAR:
return 1;
default:
return 0;
}
return 0;
}
/*-------------------------------------------------------------------------*/
static int HdbArrayNode(SConnection * pCon, SicsInterp * pSics, void *pData,
int argc, char *argv[])
{
pHdb node = NULL;
pObjectDescriptor pDes = NULL;
int length, idx;
hdbValue v;
if (argc < 4) {
SCWrite(pCon, "ERROR: need at least three arguments to harray", eError);
return 0;
}
if (!SCMatchRights(pCon, usUser)) {
return 0;
}
node = GetHipadabaNode(root, argv[1]);
if (node == NULL) {
SCPrintf(pCon, eError, "ERROR: path %s NOT found!", argv[1]);
return 0;
}
if(!isArrayNode(node)){
SCPrintf(pCon,eError,"ERROR: %s is no array node!", argv[1]);
return 0;
}
if(strcmp(argv[2], "resize") == 0){
length = atoi(argv[3]);
v = makeHdbValue(node->value.dataType, length);
UpdateHipadabaPar(node, v, pCon);
ReleaseHdbValue(&v);
SCSendOK(pCon);
return 1;
}
idx = atoi(argv[2]);
if(idx < 0 || idx >= node->value.arrayLength ){
SCPrintf(pCon,eError,"ERROR: %d is out of range 0 - %d",
idx, node->value.arrayLength);
return 0;
}
switch(node->value.dataType){
case HIPINTAR:
case HIPINTVARAR:
node->value.v.intArray[idx] = atoi(argv[3]);
break;
case HIPFLOATAR:
case HIPFLOATVARAR:
node->value.v.floatArray[idx] = atof(argv[3]);
break;
}
NotifyHipadabaPar(node, pCon);
SCSendOK(pCon);
return 1;
}
/*-------------------------------------------------------------------------*/
static hdbCallbackReturn ChainCallback(pHdb node, void *userData,
pHdbMessage message)
@@ -3480,6 +3549,7 @@ int InstallSICSHipadaba(SConnection * pCon, SicsInterp * pSics,
AddCommand(pSics, "hinfo", HdbNodeInfo, NULL, NULL);
AddCommand(pSics, "hval", HdbNodeVal, NULL, NULL);
AddCommand(pSics, "hchain", ChainHdbNode, NULL, NULL);
AddCommand(pSics, "harray", HdbArrayNode, NULL, NULL);
AddCommand(pSics, "hcommand", SicsCommandNode, NULL, NULL);
AddCommand(pSics, "hsetprop", SetSICSHdbProperty, NULL, NULL);
AddCommand(pSics, "hdelprop", DelSICSHdbProperty, NULL, NULL);