A number of smaller adpations
This commit is contained in:
@ -19,8 +19,8 @@
|
||||
One of those: alarmString.h cannot be doubly included into the
|
||||
same application
|
||||
*/
|
||||
/*#include <alarmString.h> */
|
||||
extern char *epicsAlarmConditionStrings[];
|
||||
#include <alarmString.h>
|
||||
/* extern char *epicsAlarmConditionStrings[]; */
|
||||
|
||||
/*
|
||||
* we have a SICS tasks which polls EPICS regularly.
|
||||
|
@ -298,11 +298,8 @@ static void tableInfo(pTableDrive self, SConnection * pCon)
|
||||
/*------------------------------------------------------------------------*/
|
||||
static void tableSetPar(pMotor pMot, char *name, float value)
|
||||
{
|
||||
ObPar *ob = NULL;
|
||||
|
||||
ob = ObParFind(pMot->ParArray, name);
|
||||
assert(ob != NULL);
|
||||
ob->fVal = value;
|
||||
MotorSetPar(pMot,pServ->dummyCon,name,value);
|
||||
}
|
||||
|
||||
/*------------------------------------------------------------------------
|
||||
|
@ -400,7 +400,7 @@ static int TASHeader(pScanData self)
|
||||
start with the scan variables
|
||||
*/
|
||||
if (pTAS->iPOL >= 0) {
|
||||
strcpy(pBueffel, "FORMT: (I4,I4,");
|
||||
strcpy(pBueffel, "FORMT: (I4,I4,1X,");
|
||||
strcpy(pHeader, " PNT PAL");
|
||||
} else {
|
||||
strcpy(pBueffel, "FORMT: (I4,1X,");
|
||||
@ -495,7 +495,7 @@ static int TASScanPoint(pScanData self, int iPoint)
|
||||
write point number
|
||||
*/
|
||||
if (pTAS->iPOL > 0) {
|
||||
sprintf(pBueffel, "%3d %3d", iPoint + 1, pTAS->iPOL);
|
||||
sprintf(pBueffel, "%3d %3d ", iPoint + 1, pTAS->iPOL);
|
||||
} else {
|
||||
sprintf(pBueffel, "%4d ", iPoint + 1);
|
||||
}
|
||||
|
29
utils/decodehmdata.c
Executable file
29
utils/decodehmdata.c
Executable file
@ -0,0 +1,29 @@
|
||||
/**
|
||||
* This is a little program which reads the content of a historgram
|
||||
* memory data file and prints the values to stdout
|
||||
*
|
||||
* Mark Koennecke, Gerd Theidel, September 2005
|
||||
*/
|
||||
#include <stdio.h>
|
||||
|
||||
int main(int argc, char *argv[]){
|
||||
FILE *fd = NULL;
|
||||
int val;
|
||||
|
||||
if(argc < 2){
|
||||
puts("Usage:\n\tdecodehmdata datafile\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
fd = fopen(argv[1],"r");
|
||||
if(fd == NULL){
|
||||
puts("Cannot open data file\n");
|
||||
exit(1);
|
||||
}
|
||||
while(fread(&val,sizeof(int),1,fd) == 1){
|
||||
fprintf(stdout,"%d\n",ntohl(val));
|
||||
}
|
||||
fclose(fd);
|
||||
exit(0);
|
||||
}
|
||||
|
@ -21,7 +21,8 @@ proc replaceServer {inst} {
|
||||
execCommand "ssh ${inst}@${inst} monit stop sicsserver"
|
||||
execCommand "ssh ${inst}@${inst} monit stop simserver"
|
||||
execCommand "scp ./SICServer ${inst}@${inst}:${inst}_sics"
|
||||
execCommand "ssh ${inst}@${inst} updatesicscommon"
|
||||
execCommand "ssh ${inst}@${inst} rm ${inst}_sics/core.*"
|
||||
# execCommand "ssh ${inst}@${inst} updatesicscommon"
|
||||
execCommand "ssh ${inst}@${inst} monit start sicsserver"
|
||||
execCommand "ssh ${inst}@${inst} monit start simserver"
|
||||
}
|
||||
|
54
utils/testtransfer
Executable file
54
utils/testtransfer
Executable file
@ -0,0 +1,54 @@
|
||||
#!/usr/bin/tclsh
|
||||
#----------------------------------------------------------
|
||||
# A script for testing if the transfer of data files
|
||||
# from instrument computers to AFS works
|
||||
#
|
||||
# Mark Koennecke, December 2015
|
||||
#----------------------------------------------------------
|
||||
|
||||
set instlist [list amor boa dmc eiger focus hrpt mars \
|
||||
morpheus narziss orion poldi rita2 sans sans2 tasp trics]
|
||||
|
||||
|
||||
proc execCommand {command} {
|
||||
puts stdout "Doing $command"
|
||||
set status [catch {eval exec $command} msg]
|
||||
if {$status != 0} {
|
||||
puts stdout "ERROR: $msg "
|
||||
}
|
||||
}
|
||||
#-----------------------------------------------------------
|
||||
proc testTransfer {inst} {
|
||||
set year [clock format [clock seconds] -format "%Y"]
|
||||
set tmpfile /tmp/gaga.dat
|
||||
execCommand "ssh ${inst}@${inst} cat data/${year}/DataNumber > $tmpfile"
|
||||
set f [open $tmpfile r]
|
||||
set num [string trim [gets $f]]
|
||||
set hun [expr $num /1000]
|
||||
set filename [format "/afs/psi.ch/project/sinqdata/%s/%s/%03d/%s%4dn%06d.*" \
|
||||
$year $inst $hun $inst $year $num]
|
||||
set status [catch {glob $filename} l]
|
||||
if {$status == 0 && [llength $l] >= 1} {
|
||||
puts stdout "$inst is good"
|
||||
} else {
|
||||
puts stdout "File $filename not fond, problem at $inst"
|
||||
}
|
||||
}
|
||||
|
||||
if {[llength $argv] < 1} {
|
||||
puts stdout "usage:\n\ttesttransfer instname| all"
|
||||
exit 1
|
||||
}
|
||||
|
||||
set inst [lindex $argv]
|
||||
|
||||
if {[string compare $inst all] == 0} {
|
||||
foreach inst $instlist {
|
||||
testTransfer $inst
|
||||
}
|
||||
} else {
|
||||
testTransfer $inst
|
||||
}
|
||||
|
||||
puts stdout "Done"
|
||||
|
Reference in New Issue
Block a user