From b1d7a4348821604583ac1acefa0eea31c9691d45 Mon Sep 17 00:00:00 2001 From: Takuo Yasunaga Date: Sun, 30 Jan 2022 03:43:37 +0900 Subject: [PATCH] Add: eosPointPositionCorrection Please enter the commit message for your changes. Lines starting with '#' will be ignored, and an empty message aborts the commit. On branch master Your branch is up to date with 'origin/master'. Changes to be committed: new file: bin/eosPointPositionCorrection new file: include/leosPointPositionCorrection.h modified: src/Objects/General/eosPoint/doc/eosPoint.html modified: src/Objects/General/eosPoint/src/.CHeader modified: src/Objects/General/eosPoint/src/eosPointUtil.c new file: src/Objects/General/eosPoint/src/leosPointPositionCorrection.c new file: src/Objects/General/eosPoint/src/leosPointPositionCorrection.h new file: src/Objects/General/eosPoint/src/leosPointPositionCorrection.h.org modified: src/Tools/Config/Define.inc new file: src/Tools/eosPoint/eosPointPositionCorrection/Config/Define.inc new file: src/Tools/eosPoint/eosPointPositionCorrection/Config/OptionControlFile new file: src/Tools/eosPoint/eosPointPositionCorrection/Config/Target.inc new file: src/Tools/eosPoint/eosPointPositionCorrection/Makefile new file: src/Tools/eosPoint/eosPointPositionCorrection/doc/Makefile new file: src/Tools/eosPoint/eosPointPositionCorrection/inc/config.h new file: src/Tools/eosPoint/eosPointPositionCorrection/inc/eosPointPositionCorrection.h new file: src/Tools/eosPoint/eosPointPositionCorrection/src/.Depend new file: src/Tools/eosPoint/eosPointPositionCorrection/src/.Source new file: src/Tools/eosPoint/eosPointPositionCorrection/src/Makefile new file: src/Tools/eosPoint/eosPointPositionCorrection/src/X86MAC64 new file: src/Tools/eosPoint/eosPointPositionCorrection/src/argCheck.c new file: src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.c new file: src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.html new file: src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.pane new file: src/Tools/eosPoint/eosPointPositionCorrection/src/init.c new file: src/Tools/eosPoint/eosPointPositionCorrection/src/test/Makefile new file: src/Tools/eosPoint/eosPointPositionCorrection/src/test/data new file: src/Tools/eosPoint/eosPointPositionCorrection/src/usage.c new file: src/Tools/eosPoint/eosPointPositionCorrection/src/util.c Changes not staged for commit: modified: include/eosMATH.h --- bin/eosPointPositionCorrection | 1 + include/leosPointPositionCorrection.h | 54 +++ src/Objects/General/eosPoint/doc/eosPoint.html | 11 - src/Objects/General/eosPoint/src/.CHeader | 1 + src/Objects/General/eosPoint/src/eosPointUtil.c | 2 + .../eosPoint/src/leosPointPositionCorrection.c | 176 +++++++++ .../eosPoint/src/leosPointPositionCorrection.h | 54 +++ .../eosPoint/src/leosPointPositionCorrection.h.org | 0 src/Tools/Config/Define.inc | 11 + .../eosPointPositionCorrection/Config/Define.inc | 4 + .../Config/OptionControlFile | 10 + .../eosPointPositionCorrection/Config/Target.inc | 0 .../eosPoint/eosPointPositionCorrection/Makefile | 115 ++++++ .../eosPointPositionCorrection/doc/Makefile | 2 + .../eosPointPositionCorrection/inc/config.h | 6 + .../inc/eosPointPositionCorrection.h | 59 +++ .../eosPointPositionCorrection/src/.Depend | 0 .../eosPointPositionCorrection/src/.Source | 0 .../eosPointPositionCorrection/src/Makefile | 430 +++++++++++++++++++++ .../eosPointPositionCorrection/src/X86MAC64 | 1 + .../eosPointPositionCorrection/src/argCheck.c | 140 +++++++ .../src/eosPointPositionCorrection.c | 55 +++ .../src/eosPointPositionCorrection.html | 25 ++ .../src/eosPointPositionCorrection.pane | 20 + .../eosPoint/eosPointPositionCorrection/src/init.c | 103 +++++ .../eosPointPositionCorrection/src/test/Makefile | 25 ++ .../eosPointPositionCorrection/src/test/data | 1 + .../eosPointPositionCorrection/src/usage.c | 40 ++ .../eosPoint/eosPointPositionCorrection/src/util.c | 4 + 29 files changed, 1339 insertions(+), 11 deletions(-) create mode 120000 bin/eosPointPositionCorrection create mode 100644 include/leosPointPositionCorrection.h create mode 100644 src/Objects/General/eosPoint/src/leosPointPositionCorrection.c create mode 100644 src/Objects/General/eosPoint/src/leosPointPositionCorrection.h create mode 100644 src/Objects/General/eosPoint/src/leosPointPositionCorrection.h.org create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/Config/Define.inc create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/Config/OptionControlFile create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/Config/Target.inc create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/Makefile create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/doc/Makefile create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/inc/config.h create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/inc/eosPointPositionCorrection.h create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/.Depend create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/.Source create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/Makefile create mode 120000 src/Tools/eosPoint/eosPointPositionCorrection/src/X86MAC64 create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/argCheck.c create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.c create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.html create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.pane create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/init.c create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/test/Makefile create mode 120000 src/Tools/eosPoint/eosPointPositionCorrection/src/test/data create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/usage.c create mode 100755 src/Tools/eosPoint/eosPointPositionCorrection/src/util.c diff --git a/bin/eosPointPositionCorrection b/bin/eosPointPositionCorrection new file mode 120000 index 0000000000..eddb95508d --- /dev/null +++ b/bin/eosPointPositionCorrection @@ -0,0 +1 @@ +../sbin/MachineIndependent \ No newline at end of file diff --git a/include/leosPointPositionCorrection.h b/include/leosPointPositionCorrection.h new file mode 100644 index 0000000000..c26714a740 --- /dev/null +++ b/include/leosPointPositionCorrection.h @@ -0,0 +1,54 @@ +/* +# leosPointPositionCorrection.h : $Revision$ +# $Date$ +# Created by $Author$ +# Usage : leosPointPositionCorrection.h +# Attention +# $Loccker$ +# $State$ +# +*/ +/* $Log$ */ +#ifndef LEOSPOINT_POSITION_CORRECTION_H +#define LEOSPOINT_POSITION_CORRECTION_H + +#include + +/* constant begin */ + +typedef enum leosPointPositionCorrectionMode { + a=0, + b=1 +} leosPointPositionCorrectionMode; + +/* constant end */ + +/* struct begin */ + +typedef struct leosPointPositionCorrectionInfo { + // Input + int n; + + // Output + int m; + eosPoint db; +} leosPointPositionCorrectionInfo; + +/* struct end */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* prototype begin */ + +extern int leosPointPositionCorrection(eosPoint* outP, eosPoint* inP, leosPointPositionCorrectionInfo* linfo, int mode); + +/* prototype end */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LEOSPOINT_POSITION_CORRECTION_H*/ + diff --git a/src/Objects/General/eosPoint/doc/eosPoint.html b/src/Objects/General/eosPoint/doc/eosPoint.html index 98d4fe3d80..d68994ba20 100644 --- a/src/Objects/General/eosPoint/doc/eosPoint.html +++ b/src/Objects/General/eosPoint/doc/eosPoint.html @@ -3,17 +3,6 @@

Information from source codes

-../src/eosPointCopy.c:
-
-../src/eosPointProject.c:
-
-../src/eosPointRead.c:
-
-../src/eosPointRotate.c:
-
-../src/eosPointUtil.c:
-
-../src/eosPointWrite.c:
 

diff --git a/src/Objects/General/eosPoint/src/.CHeader b/src/Objects/General/eosPoint/src/.CHeader index 35bb91ed27..01bf04ae90 100755 --- a/src/Objects/General/eosPoint/src/.CHeader +++ b/src/Objects/General/eosPoint/src/.CHeader @@ -1,2 +1,3 @@ CHeader = \ +leosPointPositionCorrection.h \ diff --git a/src/Objects/General/eosPoint/src/eosPointUtil.c b/src/Objects/General/eosPoint/src/eosPointUtil.c index 94abbd0405..2cae89f8ba 100644 --- a/src/Objects/General/eosPoint/src/eosPointUtil.c +++ b/src/Objects/General/eosPoint/src/eosPointUtil.c @@ -11,6 +11,7 @@ */ static char __sccs_id[] = "%Z%eosPointUtil ver%I%; Date:%D% %Z%"; +#include "genUtil.h" #include "Memory.h" #include "../inc/eosPoint.h" @@ -65,6 +66,7 @@ eosPointCoordSet(eosPointCoord* pc, eosPointParaTypeReal x, eosPointParaTypeReal void eosPointCoordSigSet(eosPointCoord* pc, eosPointParaTypeReal x, eosPointParaTypeReal y, eosPointParaTypeReal z) { + pc->sigma = sqrt(SQR(x) + SQR(y) + SQR(z)); pc->sig.data[0] = x; pc->sig.data[1] = y; pc->sig.data[2] = z; diff --git a/src/Objects/General/eosPoint/src/leosPointPositionCorrection.c b/src/Objects/General/eosPoint/src/leosPointPositionCorrection.c new file mode 100644 index 0000000000..a243d2cec2 --- /dev/null +++ b/src/Objects/General/eosPoint/src/leosPointPositionCorrection.c @@ -0,0 +1,176 @@ +/* +# %M% %Y% %I% +# The latest update : %G% at %U% +# +#%Z% leosPointPositionCorrection ver %I% +#%Z% Created by +#%Z% +#%Z% Usage : leosPointPositionCorrection +#%Z% Attention +#%Z% +*/ +static char __sccs_id[] = "%Z%leosPointPositionCorrection ver%I%; Date:%D% %Z%"; + +#include +#include +#include +#include +#define GLOBAL_DECLARATION + +#undef DEBUG +#include "genUtil.h" +#include "../inc/eosPoint.h" +#include "./leosPointPositionCorrection.h" +#include "gsl/gsl_math.h" +#include "gsl/gsl_vector.h" +#include "gsl/gsl_matrix.h" +#include "gsl/gsl_permutation.h" +#include "gsl/gsl_blas.h" +#include "gsl/gsl_linalg.h" + +int +leosPointPositionCorrection(eosPoint* outP, eosPoint* inP, leosPointPositionCorrectionInfo* linfo, int mode) +{ + gsl_vector* r; + gsl_vector* dr; + gsl_vector* b; + gsl_vector* db; + gsl_matrix* A; + gsl_matrix* AtA; + gsl_permutation* p; + int signum; + gsl_matrix* AtAInv; + gsl_matrix* AtAInvAt; + int count = 0; + int i, j, k, l; + eosPointCoord pc; + + linfo->m = linfo->n*(linfo->n - 1)/2; + + DEBUGPRINT1("VECTOR: %d \n", (linfo->n-1)*3); + r = gsl_vector_alloc((linfo->n-1)*3); + dr = gsl_vector_alloc((linfo->n-1)*3); + DEBUGPRINT1("VECTOR: %d \n", linfo->m*3); + b = gsl_vector_alloc(linfo->m*3); + db = gsl_vector_alloc(linfo->m*3); + + eosPointCoordInit(&pc, 0); + eosPointTop(inP); + count=0; + while(inP->current != NULL){ + count++; + eosPointNext(inP); + } + if(count!=linfo->m) { + fprintf(stderr, "n %d: m %d is different from data number %d\n", linfo->n, linfo->m, count); + return -1; + } + eosPointTop(inP); + count=0; + while(inP->current != NULL){ + DEBUGPRINT4("%d: %f %f %f\n", count, inP->current->p.coord.data[0], inP->current->p.coord.data[1], inP->current->p.coord.data[2]) + gsl_vector_set(b, count*3, inP->current->p.coord.data[0]); + gsl_vector_set(b, count*3+1, inP->current->p.coord.data[1]); + gsl_vector_set(b, count*3+2, inP->current->p.coord.data[2]); + count++; + eosPointNext(inP); + } + +/* + ri = shift(i, i+1) + i = 1...n; + + B1 = b12 = r1 + B2 = b13 = r1 + r2 + ... + b23 = r2 + b24 = r2 + r3 + b25 = r2 + r3 + r4 + ... + Bk = bij = ri + ...+ rj-1 +... + Bm = rn-1 + m = 1...n(n-1)/2 + + b = A r + r <- (At A)-1 At b + +*/ + A = gsl_matrix_calloc(linfo->m*3, (linfo->n-1)*3); + DEBUGPRINT2("MATRIX: %d %d\n", linfo->m*3, (linfo->n-1)*3); + k = 0; + for(i=0; i< linfo->n-1; i++) { + for(j=i+1; j< linfo->n; j++) { // bij + DEBUGPRINT3("%d (%d, %d)\n", k, i, j); + for(l=i; lm) { + DEBUGPRINT("SUCCESS\n"); + DEBUGPRINT1("Count: %d\n", k); +#ifdef DEBUG + //gsl_matrix_fprintf(stderr, A, "%g"); +#endif + } else { + return -1; + } + + // Least Square + // r = (At A)-1 At b + AtA = gsl_matrix_calloc((linfo->n-1)*3, (linfo->n-1)*3); + p = gsl_permutation_alloc((linfo->n-1)*3); + AtAInv = gsl_matrix_calloc((linfo->n-1)*3, (linfo->n-1)*3); + AtAInvAt = gsl_matrix_calloc((linfo->n-1)*3, linfo->m*3); + + gsl_blas_dgemm(CblasTrans, CblasNoTrans, 1, A, A, 0.0, AtA); + gsl_linalg_LU_decomp(AtA, p, &signum); // LU decomp + gsl_linalg_LU_invert(AtA, p, AtAInv); // Inv + gsl_blas_dgemm(CblasNoTrans, CblasTrans, 1, AtAInv, A, 0.0, AtAInvAt); + gsl_blas_dgemv(CblasNoTrans, 1.0, AtAInvAt, b, 1.0, r); + + // db = A r - b + gsl_blas_dgemv(CblasNoTrans, 1.0, A, r, 0.0, db); + gsl_blas_daxpy(-1.0, b, db); + + eosPointInit(&(linfo->db), NULL); + for(k=0; km; k++) { + eosPointCoordSet(&pc, fabs(gsl_vector_get(db, k*3)), + fabs(gsl_vector_get(db, k*3+1)), + fabs(gsl_vector_get(db, k*3+2))); + eosPointAppend(&(linfo->db), &pc, 0); + } + // r = (At A)-1 At b + // |dr| = sqrt((At A)-1) At |db|^2) + gsl_vector_mul(db, db); + gsl_matrix_mul_elements(AtAInvAt, AtAInvAt); + gsl_blas_dgemv(CblasNoTrans, 1.0, AtAInvAt, db, 0.0, dr); + + // eosPoint + eosPointInit(outP, NULL); + for(k=0; kn-1; k++) { + eosPointCoordSet(&pc, gsl_vector_get(r, k*3), + gsl_vector_get(r, k*3+1), + gsl_vector_get(r, k*3+2)); + eosPointCoordSigSet(&pc, sqrt(gsl_vector_get(dr, k*3 )), + sqrt(gsl_vector_get(dr, k*3+1)), + sqrt(gsl_vector_get(dr, k*3+2))); + eosPointAppend(outP, &pc, 0); + } + + gsl_vector_free(r); + gsl_vector_free(dr); + gsl_vector_free(b); + gsl_vector_free(db); + gsl_matrix_free(A); + gsl_matrix_free(AtA); + gsl_matrix_free(AtAInv); + gsl_matrix_free(AtAInvAt); + gsl_permutation_free(p); + return count; +} diff --git a/src/Objects/General/eosPoint/src/leosPointPositionCorrection.h b/src/Objects/General/eosPoint/src/leosPointPositionCorrection.h new file mode 100644 index 0000000000..c26714a740 --- /dev/null +++ b/src/Objects/General/eosPoint/src/leosPointPositionCorrection.h @@ -0,0 +1,54 @@ +/* +# leosPointPositionCorrection.h : $Revision$ +# $Date$ +# Created by $Author$ +# Usage : leosPointPositionCorrection.h +# Attention +# $Loccker$ +# $State$ +# +*/ +/* $Log$ */ +#ifndef LEOSPOINT_POSITION_CORRECTION_H +#define LEOSPOINT_POSITION_CORRECTION_H + +#include + +/* constant begin */ + +typedef enum leosPointPositionCorrectionMode { + a=0, + b=1 +} leosPointPositionCorrectionMode; + +/* constant end */ + +/* struct begin */ + +typedef struct leosPointPositionCorrectionInfo { + // Input + int n; + + // Output + int m; + eosPoint db; +} leosPointPositionCorrectionInfo; + +/* struct end */ + +#ifdef __cplusplus +extern "C" { +#endif + +/* prototype begin */ + +extern int leosPointPositionCorrection(eosPoint* outP, eosPoint* inP, leosPointPositionCorrectionInfo* linfo, int mode); + +/* prototype end */ + +#ifdef __cplusplus +}; +#endif + +#endif /* LEOSPOINT_POSITION_CORRECTION_H*/ + diff --git a/src/Objects/General/eosPoint/src/leosPointPositionCorrection.h.org b/src/Objects/General/eosPoint/src/leosPointPositionCorrection.h.org new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/Tools/Config/Define.inc b/src/Tools/Config/Define.inc index 9ee2d89475..9367728a4d 100644 --- a/src/Tools/Config/Define.inc +++ b/src/Tools/Config/Define.inc @@ -1 +1,12 @@ WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools +WORLDNAME=Tools diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/Config/Define.inc b/src/Tools/eosPoint/eosPointPositionCorrection/Config/Define.inc new file mode 100755 index 0000000000..6cff3f6988 --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/Config/Define.inc @@ -0,0 +1,4 @@ +OBJECTNAME = eosPointPositionCorrection +EXTRA_LIB = -lgsl -lcblas -lm +EXTRA_CCOPTS = +EXTRA_INC = diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/Config/OptionControlFile b/src/Tools/eosPoint/eosPointPositionCorrection/Config/OptionControlFile new file mode 100755 index 0000000000..66bb184e0b --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/Config/OptionControlFile @@ -0,0 +1,10 @@ +# OptionControlFile +# FileFormat +"-i","-i[nput]","Input:eosPoint","Essential","1","1","In","inFile::eosPoint","NULL" +"-it","-i[nput]t[ype]","Input:eosPointMode","Optional","1","1","InType","Integer","0" +"-n","-n[umber]","Input:number of Point, n, dependent upon m=n/(n-1)/2, a point number in In","Optional","1","1","N","Integer","-1" +"-o","-o[utput]","Output:eosPoint","Optional","1","1","Out","outFile::eosPoint","stdout" +"-ot","-o[utput]t[ype]","Output:eosPoint","Optional","1","1","OutType","Integer","0" +"-delta","-delta","Output:eosPoint","Optional","1","1","OutDelta","outFile::eosPoint","stdout" +"-c","-c[onfig]","ConfigurationFile","Optional","1","1","configFile","inFile","NULL" +"-m","-m[ode]","Mode","Optional","1","1","mode","Integer","0" diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/Config/Target.inc b/src/Tools/eosPoint/eosPointPositionCorrection/Config/Target.inc new file mode 100755 index 0000000000..e69de29bb2 diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/Makefile b/src/Tools/eosPoint/eosPointPositionCorrection/Makefile new file mode 100755 index 0000000000..3d1cbd98da --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/Makefile @@ -0,0 +1,115 @@ +include ../../../Config/Define.inc +include ../../Config/Define.inc +include ../Config/Define.inc +include Config/Define.inc + +all: + cd src; make all; cd .. + +install: + cd src; make install; cd .. + + +putSF: + if [ -f private ] ; \ + then \ + echo "$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME) is private"; \ + else \ + cvs -z4 -d:ext:$$USER@$$EOS_SOURCEFORGE commit || cvs -z4 -d:ext:$$USER@$$EOS_SOURCEFORGE import src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME); \ + fi + +put: + cd src; make put; cd .. + +clean: + cd src; make clean; cd .. + +depend: + cd src; make depend; cd .. + +check: + @if [ ! -d $(EOS_HOME)/hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) ] ; then \ + echo making directory; \ + mkdir -p $(EOS_HOME)/hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE); \ + fi + ln -sf ../../../../../hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) src/$(OSTYPE); + @$(RM) src/Makefile + @echo "New src/Makefile" + @$(CP) ../../../Config/Template/$(WORLDNAME)Template.Dir/src/Makefile src/Makefile + @cd src; rm -f $(OSTYPE)/.Depend; touch $(OSTYPE)/.Depend; make depend + +update: + @if [ ! -d $(EOS_HOME)/hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) ] ; then \ + echo making directory; \ + mkdir -p $(EOS_HOME)/hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE); \ + fi + ln -sf ../../../../../hostdepend/$(OSTYPE)/src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) src/$(OSTYPE); + @$(RM) src/Makefile + @echo "New src/Makefile" + @$(CP) ../../../Config/Template/$(WORLDNAME)Template.Dir/src/Makefile src/Makefile + @cd src; rm -f $(OSTYPE)/.Depend; touch $(OSTYPE)/.Depend; echo "Y" | make update + +cvsupdate:: + cvs -d $(EOS_CVSROOT) update -d + +cvscommit:: + cvs -d $(EOS_CVSROOT) commit + +backup: + @cd ../../../..; \ + echo $(OBJECTNAME) ; \ + tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Config ; \ + tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Makefile ;\ + tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/.[A-z]* ; \ + tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/inc ; \ + tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/doc; \ + tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/wish; \ + tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/[A-z]*.[A-z]*; \ + tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/.[A-z]*; \ + tar uvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/Makefile + +backup-all: + @cd ../../../..; \ + echo $(OBJECTNAME) ; \ + tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Config ; \ + tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Makefile ;\ + tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/.[A-z]* ; \ + tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/inc ; \ + tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/doc; \ + tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/wish; \ + tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/[A-z]*.[A-z]*; \ + tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/.[A-z]*; \ + tar rvf ${EOS_HOME}/backup/EosBase.tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/Makefile + +distribute: + cd ../../../..; \ + echo $(OBJECTNAME) ; \ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Config ; \ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Makefile ;\ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/.[A-z]* ; \ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/inc ; \ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/doc; \ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/wish; \ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/[A-z]*.[A-z]*; \ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/.[A-z]*; \ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/Makefile ; \ + tar uvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) + +distribute-all: + @cd ../../../..; \ + echo $(OBJECTNAME) ; \ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Config ; \ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/Makefile ;\ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/.[A-z]* ; \ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/inc ; \ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/doc; \ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/wish; \ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/[A-z]*.[A-z]*; \ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/.[A-z]*; \ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/Makefile ; \ + tar rvf ${EOS_HOME}/distribute/src.$(OSTYPE).tar src/$(WORLDNAME)/$(CLASSNAME)/$(OBJECTNAME)/src/$(OSTYPE) + +eosintroduce: + ${EOS_HOME}/sbin/eosintroduce ${WORLDNAME} ${CLASSNAME} ${OBJECTNAME} ./ + +include Config/Target.inc diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/doc/Makefile b/src/Tools/eosPoint/eosPointPositionCorrection/doc/Makefile new file mode 100755 index 0000000000..8215199e1b --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/doc/Makefile @@ -0,0 +1,2 @@ +install: + cd ../src; make install-doc; cd ../doc diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/inc/config.h b/src/Tools/eosPoint/eosPointPositionCorrection/inc/config.h new file mode 100755 index 0000000000..874da8e22a --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/inc/config.h @@ -0,0 +1,6 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#include "../inc/eosPointPositionCorrection.h" + +#endif /* CONFIG_H */ diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/inc/eosPointPositionCorrection.h b/src/Tools/eosPoint/eosPointPositionCorrection/inc/eosPointPositionCorrection.h new file mode 100755 index 0000000000..66cd367c3b --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/inc/eosPointPositionCorrection.h @@ -0,0 +1,59 @@ +#ifndef EOSPOINTPOSITIONCORRECTION_H +#define EOSPOINTPOSITIONCORRECTION_H +#include +#include + +#define OPTION_FLAG '-' +#define OPTION_FLAG_POS (0) +#define OPTION_POS (1) + + + + +typedef struct eosPointPositionCorrectionInfo { + long flagRedirect; + + long flagIn; + char* In; + FILE* fptIn; + + long flagInType; + long InType; + + long flagN; + long N; + + long flagOut; + char* Out; + FILE* fptOut; + + long flagOutType; + long OutType; + + long flagOutDelta; + char* OutDelta; + FILE* fptOutDelta; + + long flagconfigFile; + char* configFile; + FILE* fptconfigFile; + + long flagmode; + long mode; + +} eosPointPositionCorrectionInfo; +#ifdef __cplusplus +extern "C" { +#endif +extern void argCheck(eosPointPositionCorrectionInfo* info, int argc, char* avgv[]); +extern void khorosInit(int argc, char* avgv[]); +extern void init0(eosPointPositionCorrectionInfo* info); +extern void init1(eosPointPositionCorrectionInfo* info); +extern void usage(char* usage); +extern void additionalUsage(void); +extern void htmlBeforeUsage(char* usage); +extern void htmlAfterUsage(char* usage); +#ifdef __cplusplus +}; +#endif +#endif /* EOSPOINTPOSITIONCORRECTION_H */ diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/.Depend b/src/Tools/eosPoint/eosPointPositionCorrection/src/.Depend new file mode 100755 index 0000000000..e69de29bb2 diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/.Source b/src/Tools/eosPoint/eosPointPositionCorrection/src/.Source new file mode 100755 index 0000000000..e69de29bb2 diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/Makefile b/src/Tools/eosPoint/eosPointPositionCorrection/src/Makefile new file mode 100755 index 0000000000..a360703891 --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/Makefile @@ -0,0 +1,430 @@ +include ../Config/Define.inc +include ../../Config/Define.inc +include ../../../Config/Define.inc +include ../../../../Config/Define.inc + +EOSHOME=../../../../../ +DSTDIR=$(EOSHOME)/bin +DSTDOC=$(EOSHOME)/doc +DSTTAR=$(EOSHOME)/tar + +INCFILES = + +LIBFILES = \ + $(LIBPREFIX)EosObjects$(LIBSUFFIX) + +LIBFILESDEBUG = \ + $(LIBPREFIX)EosObjects.debug$(LIBSUFFIX) + +SRCC = \ + $(OBJECTNAME).c \ + init.c \ + argCheck.c \ + usage.c \ + util.c \ + +SRCCXX = \ + $(OBJECTNAME).cc \ + init.cc \ + argCheck.cc \ + usage.cc \ + util.cc \ + +MODULES = \ + $(OBJECTNAME).o \ + init.o \ + argCheck.o \ + usage.o \ + util.o \ + +REALMODULES = \ + $(OSTYPE)/$(OBJECTNAME).o \ + $(OSTYPE)/init.o \ + $(OSTYPE)/argCheck.o \ + $(OSTYPE)/usage.o \ + $(OSTYPE)/util.o + +MODULESDEBUG = \ + $(OBJECTNAME).debugo \ + init.debugo \ + argCheck.debugo \ + usage.debugo \ + util.debugo \ + +REALMODULESDEBUG = \ + $(OSTYPE)/$(OBJECTNAME).debugo \ + $(OSTYPE)/init.debugo \ + $(OSTYPE)/argCheck.debugo \ + $(OSTYPE)/usage.debugo \ + $(OSTYPE)/util.debugo + + +all: $(OSTYPE)/$(OBJECTNAME) + if [ ! -L $(OSTYPE) ] ; then \ + moveHostdependent; \ + fi + +debug: $(OSTYPE)/$(OBJECTNAME).debug + +cudagdb: $(OSTYPE)/$(OBJECTNAME).cudagdb + + +$(OSTYPE)/$(OBJECTNAME):: + @$(RM) -f $(OSTYPE)/Makefile ; \ + $(CP) $(EOS_HOME)/src/Config/Template/$(WORLDNAME)Template.Dir/src/ARCH/Makefile $(OSTYPE)/Makefile ; \ + cd $(OSTYPE); \ + $(MAKE) $(OBJECTNAME) WORLDNAME=$(WORLDNAME) CLASSNAME=$(CLASSNAME) OBJECTNAME=$(OBJECTNAME) + +$(OSTYPE)/$(OBJECTNAME).debug:: + @$(RM) -f $(OSTYPE)/Makefile ; \ + $(CP) $(EOS_HOME)/src/Config/Template/$(WORLDNAME)Template.Dir/src/ARCH/Makefile $(OSTYPE)/Makefile ; \ + cd $(OSTYPE); \ + $(MAKE) $(OBJECTNAME).debug WORLDNAME=$(WORLDNAME) CLASSNAME=$(CLASSNAME) OBJECTNAME=$(OBJECTNAME) + +$(OSTYPE)/$(OBJECTNAME).cudagdb:: + @$(RM) -f $(OSTYPE)/Makefile ; \ + $(CP) $(EOS_HOME)/src/Config/Template/$(WORLDNAME)Template.Dir/src/ARCH/Makefile $(OSTYPE)/Makefile ; \ + cd $(OSTYPE); \ + $(MAKE) $(OBJECTNAME).cudagdb WORLDNAME=$(WORLDNAME) CLASSNAME=$(CLASSNAME) OBJECTNAME=$(OBJECTNAME) + +cvsupdate:: + cvs -d $(EOS_CVSROOT) update -d + +cvscommit:: + cvs -d $(EOS_CVSROOT) commit + +edit: + @if [ -r $(OBJECTNAME).c ]; \ + then \ + sccsEdit $(OBJECTNAME).c; \ + else \ + echo "Source files are already editable"; \ + fi + @if [ -r wish/$(OBJECTNAME).wish ]; \ + then \ + cd wish; sccsEdit $(OBJECTNAME).wish; \ + else \ + echo "Source files (wish) are already editable."; \ + fi + @if [ -r ruby/$(OBJECTNAME).rb ]; \ + then \ + cd ruby; sccsEdit $(OBJECTNAME).rb; \ + else \ + echo "Source files (ruby) are already editable."; \ + fi + @if [ -r perl/$(OBJECTNAME).pl ]; \ + then \ + cd perl; sccsEdit $(OBJECTNAME).pl ; \ + else \ + echo "Source files (perl) are already editable."; \ + fi + @if [ -r ../Config/OptionControlFile ]; \ + then \ + cd ../Config; sccsEdit OptionControlFile; \ + else \ + echo "OptionControlFile are already editable."; \ + fi + +unedit: + @if [ -w $(OBJECTNAME).c ]; \ + then \ + sccsUnedit $(OBJECTNAME).c; \ + else \ + echo "Source files are not editable"; \ + fi + @if [ -w wish/$(OBJECTNAME).wish ]; \ + then \ + cd wish; sccsUnedit $(OBJECTNAME).wish; \ + else \ + echo "Source files (wish) are not editable."; \ + fi + @if [ -w ruby/$(OBJECTNAME).rb]; \ + then \ + cd ruby; sccsUnedit $(OBJECTNAME).rb; \ + else \ + echo "Source files (ruby) are not editable."; \ + fi + @if [ -w perl/$(OBJECTNAME).pl ]; \ + then \ + cd perl; sccsUnedit $(OBJECTNAME).pl ; \ + else \ + echo "Source files (ruby) are not editable."; \ + fi + @if [ -w ../Config/OptionControlFile ]; \ + then \ + cd ../Config; sccsUnedit OptionControlFile; \ + else \ + echo "OptionControlFile are not editable."; \ + fi + +report: + @if [ -r $(OBJECTNAME).c ]; \ + then \ + sccsReport $(OBJECTNAME).c; \ + else \ + echo "Source files are already editable"; \ + fi + @if [ -r wish/$(OBJECTNAME).wish ]; \ + then \ + cd wish; sccsReport $(OBJECTNAME).wish; \ + else \ + echo "Source files (wish) are already editable."; \ + fi + @if [ -r ruby/$(OBJECTNAME).rb ]; \ + then \ + cd ruby; sccsReport $(OBJECTNAME).rb; \ + else \ + echo "Source files (ruby) are already editable."; \ + fi + @if [ -r perl/$(OBJECTNAME).pl ] ; \ + then \ + cd perl; sccsReport $(OBJECTNAME).pl ; \ + else \ + echo "Source files (perl) are already editable."; \ + fi + @if [ -r ../Config/OptionControlFile ]; \ + then \ + cd ../Config; sccsReport OptionControlFile; \ + else \ + echo "OptionControlFile are already editable."; \ + fi + +clean : + rm -f *.debugo $(OSTYPE)/*.debugo *.cudagdbo $(OSTYPE)/*.cudagdbo *.o $(OSTYPE)/*.o *.linkinfo $(OSTYPE)/*.linkinfo \ + $(OSTYPE)/$(OBJECTNAME) $(OSTYPE)/*.$(OSTYPE) \ + $(OSTYPE)/$(OBJECTNAME).debug $(OSTYPE)/*.$(OSTYPE).debug \ + $(OSTYPE)/$(OBJECTNAME).cudagdb $(OSTYPE)/*.$(OSTYPE).cudagdb \ + $(OSTYPE)/$(OBJECTNAME).linkinfo $(OSTYPE)/*.$(OSTYPE).linkinfo \ + *.bak *.$(OSTYPE) core + +install: install-bin install-doc install-wish install-ruby install-shell install-perl + @if [ dummy$(KHOROS_KENGOBJ) != dummy ] ; \ + then \ + if [ -x $(KHOROS_KGENOBJ) ] ; \ + then \ + make install-khoros ; \ + fi; \ + fi + +install-bin:$(DSTDIR)/$(OSTYPE)/$(OBJECTNAME) + +$(DSTDIR)/$(OSTYPE)/$(OBJECTNAME):$(OSTYPE)/$(OBJECTNAME) $(DSTDIR)/$(OBJECTNAME) + @echo ---- Installing to bin + @echo $(DSTDIR)/$(OSTYPE)/$(OBJECTNAME) + @if [ ! -d $(DSTDIR)/$(OSTYPE) ]; \ + then \ + mkdir $(DSTDIR)/$(OSTYPE); \ + fi + @if [ -x $(OSTYPE)/$(OBJECTNAME) ]; \ + then \ + echo "Compilation is complete"; \ + $(RM) -f $(DSTDIR)/$(OSTYPE)/$(OBJECTNAME); \ + $(CD) $(OSTYPE); $(INSTALL) -m 555 $(OBJECTNAME) ../$(DSTDIR)/$(OSTYPE); \ + $(CHMOD) 555 ../$(DSTDIR)/$(OSTYPE)/$(OBJECTNAME); \ + else \ + echo "Compilation is incomplete. $(OBJECTNAME)"; \ + fi + @echo ---- end of bin + +install-wish: + @if [ -d wish ]; \ + then \ + echo "---- Tcl/Tk file Install"; \ + if [ ! -d $(DSTDIR)/wish/$(OBJECTNAME) ]; \ + then \ + mkdir $(DSTDIR)/wish/$(OBJECTNAME) ; \ + fi ; \ + $(CP) -f wish/* $(DSTDIR)/wish/$(OBJECTNAME); \ + $(CHMOD) 555 $(DSTDIR)/wish/$(OBJECTNAME)/* ;\ + touch $(DSTDIR)/wish/$(OBJECTNAME)/tclIndex;\ + $(CHMOD) 666 $(DSTDIR)/wish/$(OBJECTNAME)/tclIndex;\ + echo "---- Tcl/Tk file Installed";\ + fi + +install-ruby: + @if [ -d ruby ]; \ + then \ + echo "---- Ruby/Tk file Install"; \ + if [ ! -d $(DSTDIR)/ruby/$(OBJECTNAME) ]; \ + then \ + mkdir $(DSTDIR)/ruby/$(OBJECTNAME) ; \ + fi ; \ + $(CP) -f ruby/* $(DSTDIR)/ruby/$(OBJECTNAME); \ + $(CHMOD) 555 $(DSTDIR)/ruby/$(OBJECTNAME)/* ; \ + echo "---- Ruby/Tk file Installed"; \ + fi + +install-perl: + @if [ -d perl ]; \ + then \ + echo "---- Perl/Tk file Install"; \ + if [ ! -d $(DSTDIR)/perl/$(OBJECTNAME) ]; \ + then \ + mkdir $(DSTDIR)/perl/$(OBJECTNAME) ; \ + fi; \ + $(CP) -f perl/* $(DSTDIR)/perl/$(OBJECTNAME); \ + $(CHMOD) 555 $(DSTDIR)/perl/$(OBJECTNAME)/* ; \ + echo "---- Perl/Tk file Installed"; \ + fi + +install-shell: + @if [ ! -d $(DSTDIR)/shell/$(OBJECTNAME) ]; \ + then \ + mkdir $(DSTDIR)/shell/$(OBJECTNAME) ; \ + fi + @if [ -d shell ]; \ + then \ + echo "---- Shell file Install"; \ + if [ ! -d $(DSTDIR)/shell/$(OBJECTNAME) ]; \ + then \ + mkdir $(DSTDIR)/shell/$(OBJECTNAME) ; \ + fi ; \ + $(CP) -f shell/* $(DSTDIR)/shell/$(OBJECTNAME); \ + $(CHMOD) 555 $(DSTDIR)/shell/$(OBJECTNAME)/*; \ + echo "---- Shell file Installed"; \ + fi + +install-khoros: + @echo Installing to khoros + @if [ ! -d ../../../../../objects/script/$(OBJECTNAME) -a -f $(KHOROS_KGENOBJ) ]; \ + then \ + echo kgenobj;\ + $(KHOROS_KGENOBJ) -tb Eos -oname $(OBJECTNAME) -type script -pane -cantata true -cat Eos -subcat $(CLASSNAME) -description $(OBJECTNAME) -bname $(OBJECTNAME) -form -lang ksh ; \ + fi + @if [ ! -d ../../../../../objects/script/$(OBJECTNAME) -a -f $(KHOROS_KSET) ]; \ + then \ + $(KHOROS_KSET) -tb Eos -oname $(OBJECTNAME) -icon $(OBJECTNAME) ; \ + fi + @if [ -d ../../../../../objects/script/$(OBJECTNAME) -a -f $(KHOROS_KSET) ]; \ + then \ + $(CHMOD) -R 775 ../../../../../objects/script/$(OBJECTNAME) ; \ + if [ $? ] ; \ + then \ + echo "-- setting khoros ---" ; \ + if [ -d ../../../../../objects/script/$(OBJECTNAME)/uis/ ] ; \ + then \ + $(CD) ../../../../../objects/script/$(OBJECTNAME)/uis/ ; \ + $(RM) -f $(OBJECTNAME).pane ; \ + $(LN) -s ../../../../src/Tools/$(CLASSNAME)/$(OBJECTNAME)/src/$(OBJECTNAME).pane $(OBJECTNAME).pane; \ + $(CD) ../../ ; \ + $(CHMOD) -R 555 $(OBJECTNAME); \ + else \ + echo "../../../../../objects/script/$(OBJECTNAME)/uis/ does not exist."; \ + fi ; \ + else \ + echo "Failed !!: Cannot chage mode in installing $(OBJECTNAME) to khoros system"; \ + fi ; \ + echo "-- end of khoros-installing"; \ + fi + +install-doc: html + @if [ ! -d $(DSTDOC)/SmallTools ]; \ + then \ + mkdir $(DSTDOC)/SmallTools ;\ + fi + @if [ -f $(DSTDOC)/SmallTools/$(OBJECTNAME).html ]; \ + then \ + $(RM) -f $(DSTDOC)/SmallTools/$(OBJECTNAME).html ;\ + fi + @$(CP) $(OBJECTNAME).html $(DSTDOC)/SmallTools/$(OBJECTNAME).html + @$(CHMOD) 444 $(DSTDOC)/SmallTools/$(OBJECTNAME).html + @if [ -f ../doc/*.html ]; \ + then \ + $(CP) ../doc/*.html $(DSTDOC)/SmallTools/ ;\ + fi + @$(CHMOD) 444 $(DSTDOC)/SmallTools/$(OBJECTNAME).html + @if [ -f $(DSTDOC)/SmallTools/Makefile ]; \ + then \ + cd $(DSTDOC)/SmallTools; $(MAKE); \ + fi + +html: $(OBJECTNAME).html + +configFileRead: + @ctrl2configFileRead $(CLASSNAME) $(OBJECTNAME) ../Config/OptionControlFile + +$(OBJECTNAME).html: $(OSTYPE)/$(OBJECTNAME) + @echo creating html + @$(OSTYPE)/$(OBJECTNAME) -html 2> $(OBJECTNAME).html.tmp + @sed -e s/$(OSTYPE)\\/// $(OBJECTNAME).html.tmp > $(OBJECTNAME).html + @$(RM) $(OBJECTNAME).html.tmp + +$(DSTDIR)/$(OBJECTNAME): $(OSTYPE)/$(OBJECTNAME) + @ln -s -f ../sbin/MachineIndependent $@ + +depend:: + @echo dependency checking now + @if [ ! -L $(OSTYPE) ] ; then \ + moveHostdependent; \ + fi + rm -f $(OSTYPE)/.Depend + #echo C + @if [ -f $(OBJECTNAME).c ] ; \ + then \ + echo "dependency: *.c"; \ + echo $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) *.c ; \ + $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) *.c >> $(OSTYPE)/.Depend ; \ + fi + #echo CC + @if [ -f $(OBJECTNAME).cc ] ; \ + then \ + echo "dependency: *.cc"; \ + echo $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.cc ; \ + $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.cc >> $(OSTYPE)/.Depend ; \ + fi + @if [ -f $(OBJECTNAME).ccm ] ; \ + then \ + echo "dependency: *.ccm"; \ + echo $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.ccm ; \ + $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.ccm >> $(OSTYPE)/.Depend ; \ + fi + @if [ -f $(OBJECTNAME).cu ] ; \ + then \ + echo "dependency: *.cu"; \ + echo $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.cu ; \ + $(DEPENDCOMMAND) $(INCLUDEDIR) $(EXTRA_INC) $(EXTRA_DEFINE) $(EXTRA_CCOPTS) *.cu >> $(OSTYPE)/.Depend ; \ + fi + +update:../Config/OptionControlFile + maketool $(CLASSNAME) $(OBJECTNAME) update + +updateNoAns:../Config/OptionControlFile + maketool $(CLASSNAME) $(OBJECTNAME) update N + +changeName:: + +Test:$(OSTYPE)/$(OBJECTNAME) TestDir + @if [ -f test/Makefile ] ; \ + then \ + cd test; make ; \ + else \ + echo "No test Makefile"; \ + fi + +TestDir:: + @if [ ! -d test ] ; \ + then \ + echo "Creating test dir"; \ + mkdir test; \ + fi + @if [ ! -f test/Makefile ] ; \ + then \ + echo "Creating Makefile"; \ + cd test; \ + protoTestMakefileCreate; \ + fi + @if [ ! -d test/data ]; \ + then \ + mkdir $(EOSHOME)/data/$(OBJECTNAME); \ + cd test; \ + ln -sf ../$(EOSHOME)/data/$(OBJECTNAME) data; \ + fi + +tar:: + cd $(DSTTAR); tar cvf Tools.$(CLASSNAME).$(OBJECTNAME).tar ../bin/$(OBJECTNAME) \ + ../bin/*/$(OBJECTNAME).* \ + ../src/Tools/$(CLASSNAME)/$(OBJECTNAME) \ + ; gzip Tools.$(CLASSNAME).$(OBJECTNAME).tar + +-include $(OSTYPE)/.Depend +-include ../Config/Target.inc diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/X86MAC64 b/src/Tools/eosPoint/eosPointPositionCorrection/src/X86MAC64 new file mode 120000 index 0000000000..456117340c --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/X86MAC64 @@ -0,0 +1 @@ +../../../../../hostdepend/X86MAC64/src/Tools/eosPoint/eosPointPositionCorrection/src/X86MAC64 \ No newline at end of file diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/argCheck.c b/src/Tools/eosPoint/eosPointPositionCorrection/src/argCheck.c new file mode 100755 index 0000000000..f2f525b0c2 --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/argCheck.c @@ -0,0 +1,140 @@ +#include +#include +#include +#include +#include "../inc/config.h" +#include "genUtil.h" +#include "eosString.h" +#include "File.h" +#include "Memory.h" + + +void +argCheck(eosPointPositionCorrectionInfo* info, int argc, char* argv[]) +{ + long i; + char s[1024]; + FILE* fpt; + + if(NULL==(fpt=fopen(".EosLog", "a+"))) { + + } else { + for(i=0; iIn = stringGetNthWord(argv[i+1], 1, " ,"); + i++; + info->flagIn++; + } else { + usage(argv[0]); + exit(EXIT_FAILURE); + } + SBREAK; + } + SCASE("it") { + if(i+1InType = stringGetNthIntegerData(argv[i+1], 1, " ,"); + i++; + info->flagInType++; + } else { + usage(argv[0]); + exit(EXIT_FAILURE); + } + SBREAK; + } + SCASE("n") { + if(i+1N = stringGetNthIntegerData(argv[i+1], 1, " ,"); + i++; + info->flagN++; + } else { + usage(argv[0]); + exit(EXIT_FAILURE); + } + SBREAK; + } + SCASE("o") { + if(i+1Out = stringGetNthWord(argv[i+1], 1, " ,"); + i++; + info->flagOut++; + } else { + usage(argv[0]); + exit(EXIT_FAILURE); + } + SBREAK; + } + SCASE("ot") { + if(i+1OutType = stringGetNthIntegerData(argv[i+1], 1, " ,"); + i++; + info->flagOutType++; + } else { + usage(argv[0]); + exit(EXIT_FAILURE); + } + SBREAK; + } + SCASE("delta") { + if(i+1OutDelta = stringGetNthWord(argv[i+1], 1, " ,"); + i++; + info->flagOutDelta++; + } else { + usage(argv[0]); + exit(EXIT_FAILURE); + } + SBREAK; + } + SCASE("c") { + if(i+1configFile = stringGetNthWord(argv[i+1], 1, " ,"); + i++; + info->flagconfigFile++; + } else { + usage(argv[0]); + exit(EXIT_FAILURE); + } + SBREAK; + } + SCASE("m") { + if(i+1mode = stringGetNthIntegerData(argv[i+1], 1, " ,"); + i++; + info->flagmode++; + } else { + usage(argv[0]); + exit(EXIT_FAILURE); + } + SBREAK; + } + SCASE("h") { + usage(argv[0]); + exit(EXIT_SUCCESS); + break; + } + SCASE("html") { + htmlBeforeUsage(argv[0]); + usage(argv[0]); + htmlAfterUsage(argv[0]); + exit(EXIT_SUCCESS); + break; + } + SDEFAULT { + fprintf(stderr, "Not Supported Options: :%s\n", argv[i]); + usage(argv[0]); + exit(EXIT_FAILURE); + break; + } + SSWITCHEND; + } + } +} diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.c b/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.c new file mode 100755 index 0000000000..c14afd1bb1 --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.c @@ -0,0 +1,55 @@ +/* +# eosPointPositionCorrection : $Revision$ +# $Date$ +# Created by $Author$ +# Usage : eosPointPositionCorrection +# Attention +# $Loccker$ +# $State$ +# +*/ +#include +#include +#include +#include +#define GLOBAL_DECLARATION +#include "../inc/config.h" + +#undef DEBUG +#include "genUtil.h" +#include "eosPoint.h" + +#include "leosPointPositionCorrection.h" + +int +main(int argc, char* argv[]) +{ + eosPointPositionCorrectionInfo info; + leosPointPositionCorrectionInfo linfo; + eosPoint inP; + eosPoint outP; + + init0(&info); + argCheck(&info, argc, argv); + init1(&info); + + DEBUGPRINT("Program Start\n"); + eosPointRead(info.fptIn, &inP, info.InType); + + linfo.n = info.N; + leosPointPositionCorrection(&outP, &inP, &linfo, info.mode); + + eosPointWrite(info.fptOut, &outP, info.OutType); + if(info.flagOutDelta) { + eosPointWrite(info.fptOutDelta, &(linfo.db), 0); + } + exit(EXIT_SUCCESS); +} + +void +additionalUsage() +{ + fprintf(stderr, "----- Additional Usage -----\n"); + eosPointFileFormatUsage(stderr); +} + diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.html b/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.html new file mode 100755 index 0000000000..f95744d07e --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.html @@ -0,0 +1,25 @@ + + +eosPointPositionCorrection + + +

eosPointPositionCorrection

+

Usage

+
+Usage: eosPointPositionCorrection
+Options:
+    [-i[nput]            In                  (NULL      ).as(inFile::eosPoint    ) ] :Essential :Input:eosPoint
+    [-i[nput]t[ype]      InType              (0         ).as(Integer             ) ] :Optional  :Input:eosPointMode
+    [-n[umber]           N                   (-1        ).as(Integer             ) ] :Optional  :Input:number of Point, n, dependent upon m=n/(n-1)/2, a point number in In
+    [-o[utput]           Out                 (stdout    ).as(outFile::eosPoint   ) ] :Optional  :Output:eosPoint
+    [-o[utput]t[ype]     OutType             (0         ).as(Integer             ) ] :Optional  :Output:eosPoint
+    [-c[onfig]           configFile          (NULL      ).as(inFile              ) ] :Optional  :ConfigurationFile
+    [-m[ode]             mode                (0         ).as(Integer             ) ] :Optional  :Mode
+----- Additional Usage -----
+type-0: x y z
+type-1: x y z sig
+type-2: x y z sigx sigy sigz
+type-3: x y z sig sigx sigy sigz
+
+ + diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.pane b/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.pane new file mode 100755 index 0000000000..6d3e713eb2 --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.pane @@ -0,0 +1,20 @@ +-F 4.3 1 0 52x1+0+0 +0+0 'Cantata' cantata + -M 1 1 52x1+0+0 +1+0 ' ' subform + -P 1 0 52x1+0+1 +0+0 ' ' eosPointPositionCorrection + -D 1 0 9x1+0+0 'Options' _gui_options + -H 1 6x1+0+0 'License' 'license' $BOOTSTRAP/repos/license/License license + -E + -R 1 0 1 5x1+35+0 'Run' 'execute operation' $EOS/bin/eosPointPositionCorrection + -H 1 5x1+41+0 'Help' 'help page' $EOS/src/Tools/eosPoint/eosPointPositionCorrection/doc/eosPointPositionCorrection.doc help + -Q 1 0 5.25x1+47+0 'Close' + -I 1 0 1 1 0 1 -1x1+1+1.500000 ' ' 'In' 'Input:eosPoint' i + -i 1 0 1 0 0 -1x1+1+3.000000 0 0 0 0 0 'InType' 'Input:eosPointMode' it + -i 1 0 1 0 0 -1x1+1+4.500000 0 0 -1 0 0 'N' 'Input:number of Point, n, dependent upon m=n/(n-1)/2, a point number in In' n + -O 1 0 1 0 0 1 -1x1+1+6.000000 ' ' 'Out' 'Output:eosPoint' o + -i 1 0 1 0 0 -1x1+1+7.500000 0 0 0 0 0 'OutType' 'Output:eosPoint' ot + -O 1 0 1 0 0 1 -1x1+1+9.000000 ' ' 'OutDelta' 'Output:eosPoint' delta + -I 1 0 1 0 0 1 -1x1+1+10.500000 ' ' 'configFile' 'ConfigurationFile' c + -i 1 0 1 0 0 -1x1+1+12.000000 0 0 0 0 0 'mode' 'Mode' m + -E + -E +-E diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/init.c b/src/Tools/eosPoint/eosPointPositionCorrection/src/init.c new file mode 100755 index 0000000000..839dad302a --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/init.c @@ -0,0 +1,103 @@ +#include +#include +#include +#include +#include "../inc/config.h" +#include "genUtil.h" +#include "eosString.h" +#include "File.h" +#include "Memory.h" + + +void +init0(eosPointPositionCorrectionInfo* info) +{ + info->fptIn = NULL; info->flagIn = 0; + info->InType = 0; info->flagInType = 0; + info->N = -1; info->flagN = 0; + info->fptOut = stdout; info->flagOut = 0; + info->OutType = 0; info->flagOutType = 0; + info->fptOutDelta = stdout; info->flagOutDelta = 0; + info->fptconfigFile = NULL; info->flagconfigFile = 0; + info->mode = 0; info->flagmode = 0; +} + +void +init1(eosPointPositionCorrectionInfo* info) +{ + char s[1024]; + int i; + if(!info->flagIn) { + stringGetFromFile(s, "In", stdin, stdout, 0); + info->In = stringGetNthWord(s, 1, " ,\t"); + info->flagIn++; + } + if(info->flagIn) { + info->fptIn = fileOpen(info->In, "r"); + } + + if(info->flagInType) { + } + + if(info->flagN) { + } + + if(info->flagOut) { + info->fptOut = fileOpen(info->Out, "w"); + } + + if(info->flagOutType) { + } + + if(info->flagOutDelta) { + info->fptOutDelta = fileOpen(info->OutDelta, "w"); + } + + if(info->flagconfigFile) { + info->fptconfigFile = fileOpen(info->configFile, "r"); + } + + if(info->flagmode) { + } + +} +#ifdef KHOROS +#include +#include "bootstrap.h" +#include "dataserv.h" +#include "datamanip.h" +extern void func_usage_additions(void); +extern void func_free_args(kexit_status status, kaddr client_data); +extern void func_get_args(kform* pane); + +void +func_usage_additions(void) +{ +} +void +func_free_args(kexit_status status, kaddr client_data) +{ +} +void +func_get_args(kform* pane) +{ +} +void +khorosInit(int argc, char* argv[]) +{ + char* eospath; + char panepath[1024]; + FILE* fpt; + + eospath = getenv("EOS_HOME"); + sprintf(panepath, "%s/src/Tools/eosPoint/eosPointPositionCorrection/src/eosPointPositionCorrection.pane", eospath); + khoros_initialize(argc, argv, "EOS"); + fpt = fopen(panepath, "r"); if(NULL!=fpt) { + fclose(fpt); + kclui_initialize(panepath, KGEN_NONE, "EOS", "eosPointPositionCorrection", + func_usage_additions, + func_get_args, + func_free_args); + } +} +#endif /* KHOROS */ diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/test/Makefile b/src/Tools/eosPoint/eosPointPositionCorrection/src/test/Makefile new file mode 100755 index 0000000000..e0b5e22e13 --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/test/Makefile @@ -0,0 +1,25 @@ +include ../../Config/Define.inc +include ../../../Config/Define.inc +include ../../../../Config/Define.inc +include ../../../../../Config/Define.inc + +all: help exec + +help: + @echo "----- Help Message Check -----" + @../$(OSTYPE)/$(OBJECTNAME) -h + +exec: + @echo "----- Execution Check -----" + ../$(OSTYPE)/$(OBJECTNAME) -i data/test.in -n 3 -o data/test.out -m 0; cat data/test.out + ../$(OSTYPE)/$(OBJECTNAME) -i data/test1.in -n 3 -o data/test1.out -m 0; cat data/test1.out + ../$(OSTYPE)/$(OBJECTNAME) -i data/test2.in -n 4 -o data/test2.out -m 0; cat data/test2.out + ../$(OSTYPE)/$(OBJECTNAME) -i data/test.in -n 3 -o data/test-2.out -ot 2 -delta data/test.delta -m 0; cat data/test-2.out + ../$(OSTYPE)/$(OBJECTNAME) -i data/test1.in -n 3 -o data/test1-2.out -ot 2 -delta data/test-1.delta -m 0; cat data/test1-2.out + ../$(OSTYPE)/$(OBJECTNAME) -i data/test2.in -n 4 -o data/test2-2.out -ot 2 -delta data/test-2.delta -m 0; cat data/test2-2.out + ../$(OSTYPE)/$(OBJECTNAME) -i data/test.in -n 3 -o data/test-3.out -ot 3 -delta data/test.delta -m 0; cat data/test-3.out + ../$(OSTYPE)/$(OBJECTNAME) -i data/test1.in -n 3 -o data/test1-3.out -ot 3 -delta data/test-1.delta -m 0; cat data/test1-3.out + ../$(OSTYPE)/$(OBJECTNAME) -i data/test2.in -n 4 -o data/test2-3.out -ot 3 -delta data/test-2.delta -m 0; cat data/test2-3.out + @echo "----- Calc check -----" + +clean: diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/test/data b/src/Tools/eosPoint/eosPointPositionCorrection/src/test/data new file mode 120000 index 0000000000..f6df42237a --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/test/data @@ -0,0 +1 @@ +../../../../../..//data/eosPointPositionCorrection \ No newline at end of file diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/usage.c b/src/Tools/eosPoint/eosPointPositionCorrection/src/usage.c new file mode 100755 index 0000000000..560517efd7 --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/usage.c @@ -0,0 +1,40 @@ +#include +#include +#include "../inc/config.h" + +void +usage(char* thisProgram) +{ + fprintf(stderr, "Usage: %s\n", thisProgram); + fprintf(stderr, "Options:\n"); + fprintf(stderr, " [-i[nput] In (NULL ).as(inFile::eosPoint ) ] :Essential :Input:eosPoint\n"); + fprintf(stderr, " [-i[nput]t[ype] InType (0 ).as(Integer ) ] :Optional :Input:eosPointMode\n"); + fprintf(stderr, " [-n[umber] N (-1 ).as(Integer ) ] :Optional :Input:number of Point, n, dependent upon m=n/(n-1)/2, a point number in In\n"); + fprintf(stderr, " [-o[utput] Out (stdout ).as(outFile::eosPoint ) ] :Optional :Output:eosPoint\n"); + fprintf(stderr, " [-o[utput]t[ype] OutType (0 ).as(Integer ) ] :Optional :Output:eosPoint\n"); + fprintf(stderr, " [-delta OutDelta (stdout ).as(outFile::eosPoint ) ] :Optional :Output:eosPoint\n"); + fprintf(stderr, " [-c[onfig] configFile (NULL ).as(inFile ) ] :Optional :ConfigurationFile\n"); + fprintf(stderr, " [-m[ode] mode (0 ).as(Integer ) ] :Optional :Mode\n"); + additionalUsage(); +} + +void +htmlBeforeUsage(char* thisProgram) +{ + fprintf(stderr, "\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "%s\n", thisProgram); + fprintf(stderr, "\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "

%s

\n", thisProgram); + fprintf(stderr, "

Usage

\n"); + fprintf(stderr, "
\n");
+}
+
+void
+htmlAfterUsage(char* thisProgram)
+{
+    fprintf(stderr, "
\n"); + fprintf(stderr, "\n"); + fprintf(stderr, "\n"); +} diff --git a/src/Tools/eosPoint/eosPointPositionCorrection/src/util.c b/src/Tools/eosPoint/eosPointPositionCorrection/src/util.c new file mode 100755 index 0000000000..ee5e5f2324 --- /dev/null +++ b/src/Tools/eosPoint/eosPointPositionCorrection/src/util.c @@ -0,0 +1,4 @@ +#include +#include +#include "../inc/config.h" + -- 2.11.0