]> jspc29.x-matter.uni-frankfurt.de Git - daqdata.git/commitdiff
*** empty log message ***
authorhades <hades>
Sun, 10 Sep 2000 17:02:58 +0000 (17:02 +0000)
committerhades <hades>
Sun, 10 Sep 2000 17:02:58 +0000 (17:02 +0000)
16 files changed:
allParam/ca/README [new file with mode: 0644]
allParam/ca/caParam.c
allParam/ca/caParam.h
allParam/file/README [new file with mode: 0644]
allParam/file/fileParam.c
allParam/file/fileParam.h
allParam/ora/Makefile
allParam/ora/README [new file with mode: 0644]
allParam/ora/oraParam.h
allParam/ora/oraParam.pc
allParam/psql/README [new file with mode: 0644]
allParam/psql/psqlParam.c
allParam/psql/psqlParam.h
allParam/tcl/README [new file with mode: 0644]
allParam/tcl/tclParam.c
allParam/tcl/tclParam.h

diff --git a/allParam/ca/README b/allParam/ca/README
new file mode 100644 (file)
index 0000000..7f36757
--- /dev/null
@@ -0,0 +1,51 @@
+Author:  Benjamin Sailer
+         TUM/E12
+         Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date:    2000-09-10
+
+libcaParam.a
+============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirements
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+  To compile the channel access param library, you need the enviroment variable
+EPICS_HOME set to the root of the EPICS tree. Make assumes that the used base
+directory is right below the EPICS_HOME and called 'base/'. Tested with
+R3.13.3, libcaParam.a can happen to work with earlier versions.
+
+2. Linktime requirements
+------------------------
+
+Ensure, that the EPICS libraries linked to the final objects are the same ones
+you use to compile the libcaParam.a.
+
+3. Runtime requirments
+----------------------
+
+  At runtime the library assumes to have a channel access server within the
+EPICS_CA_ADDR_LIST that serves the parameters requested by the hosting program.
+The requested channel names are
+HAD:PARA:(uppercase <name>):(uppercase <idx>)
+and the library only asks for DBR_STRING types (as the EPICS conversion does
+not treat hex-numbers like strtoul(3) does). So conversion to integers is done
+by the library itself.
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+  Behaviour with timeouts is not understood quite well.
+
+Please send bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
index 450c8642c86756e6c74139f17fe9d00831de020c..c512adf8f0459b0b5efa2900b4b743600fa7f6af 100644 (file)
@@ -38,9 +38,9 @@ int Param_getIntArray(const Param *my, const char *name, const char *idx, int ma
        int retVal = 0;
        int i;
        char *endptr;
-       char *value[PARAM_MAX_NVALS];
+       char *value[PARAM_MAX_ARRAY_LEN];
 
-       for (i = 0 ; i < PARAM_MAX_NVALS ; i++) {
+       for (i = 0 ; i < PARAM_MAX_ARRAY_LEN ; i++) {
                value[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char));
        }
 
@@ -57,7 +57,7 @@ int Param_getIntArray(const Param *my, const char *name, const char *idx, int ma
                *rows = 0;
        }
 
-       for (i = 0 ; i <  PARAM_MAX_NVALS ; i++) {
+       for (i = 0 ; i <  PARAM_MAX_ARRAY_LEN ; i++) {
                free(value[i]);
        }
        return retVal;
index 38eb5abb4aeda0306daef66ae493d91b6d6a5f57..19f2ef6c5fb43073f857e97d3819d07d33187708 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PARAM_H
 #define PARAM_H
 
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
 #define PARAM_MAX_VALUE_LEN 128
 #define PARAM_MAX_NAME_LEN 128
 
diff --git a/allParam/file/README b/allParam/file/README
new file mode 100644 (file)
index 0000000..8330d15
--- /dev/null
@@ -0,0 +1,55 @@
+Author:  Benjamin Sailer
+         TUM/E12
+         Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date:    2000-09-10
+
+libfileParam.a
+==============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirments
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+  libfileParam.a only needs os APIs for file opening and closing. Therefore
+no special libraries are needed at compiletime.
+
+2. Linktime requirments
+-----------------------
+
+  See compiletime requirements.
+
+3. Runtime requirments
+----------------------
+
+  At runtime a file is opened containing data in a tcl-shaped way (arrays are
+sets of parameters with a succeeding array index number in the tcl idx). When
+the enviroment variable DAQSLOW_PARAM_FILE is set, the library looks up there
+if it can find the data. If DAQSLOW_PARAM_FILE is not set, the library assumes
+the param file to be 'param.tcl' in the working directory.
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+  Note that libfileParam.a is only existing for historical reasons and for the
+poor people who don't have tcl available on their system. It is a little clone
+of the libtclParam.a without requirnig the libtcl.so and has two
+disadvantages:
+- The simple algorithm does not allow the string values (and notations of a int
+  value, too) to contain whitespaces.
+- The constructor of param allocates much memory to copy the entire file to
+  it. There is a magic maximum size for the number of single requested elements
+  set to PARAM_MAX_NVALS which is now set to 1024.
+libfileParam.a is not likely to be developed any further but anyhow:
+
+Please send bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
index c2bae3fdbceb4b41b516acbec49f8d921267ab24..d4c65e6fd8af746c94a6d3b81996fa4d99c08366 100644 (file)
@@ -74,7 +74,7 @@ int Param_getIntArray(const Param *my, const char *name, const char *idx, int ma
        int retVal = 0;
        int i;
        char *endptr;
-       char *strval[PARAM_MAX_NVALS];
+       char *strval[PARAM_MAX_ARRAY_LEN];
 
        for (i = 0 ; i < maxrows ; i++) {
                strval[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char));
index 135a1cc0f9b5526d8d358a32b560acce7e6a68c4..65b5078d7453a44ee7aa129ff3dd9224efa53d75 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PARAM_H
 #define PARAM_H
 
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
 #define PARAM_MAX_VALUE_LEN 128
 #define PARAM_MAX_NAME_LEN 128
 
@@ -9,6 +9,8 @@
  * Section containing struct Param (different in the different param.h's) *
  **************************************************************************/
 
+#define PARAM_MAX_NVALS 1024
+
 typedef struct ParamS {
        char *strerror;
        int nVals;
index bac7c62cbcce68b09f2984763cab3bea12bec5ca..7a66fb872b8cd16c374b5b9ccbba8ea7dd2b7611 100644 (file)
@@ -1,6 +1,6 @@
 CFLAGS = -g -ansi -Wall -I$(ORACLE_HOME)/precomp/public/
 
-ORA_USER = daq/daqall@db-hades.gsi.de
+ORA_USER = hades/hades@db-hades.gsi.de
 
 PROC = $(ORACLE_HOME)/bin/proc
 PROCFLAGS = oraca=yes parse=partial sqlcheck=semantics \
diff --git a/allParam/ora/README b/allParam/ora/README
new file mode 100644 (file)
index 0000000..162035f
--- /dev/null
@@ -0,0 +1,57 @@
+Author:  Benjamin Sailer
+         TUM/E12
+         Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date:    2000-09-10
+
+liboraParam.a
+=============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirments
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+  At compiletime liboraParam.a needs the enviroment variable ORACLE_HOME
+pointing to the root of the oracle development tree (containing the precompiler
+proc, the include files oraca.h and sqlca.h). Additionally, you must have a
+network connection to the hades oracle database on the GSI linux cluster. User
+and password for a reading access are hardwired in the code (which is not very
+elegant but an intrinsic feature of proc).
+
+2. Linktime requirments
+-----------------------
+
+  The above mentioned ORACLE_HOME must also exist at linktime, in this case to
+provide the oracle sql libraries which are listed in the test directory
+Makefile.
+
+3. Runtime requirments
+----------------------
+
+  At runtime you also use hard wired access information and have to have a the
+connection to the database, to. Therein the used parameters are all stored in
+a table (view, to be more precise) that is called DAQ.PARAMS and has the
+attributes NAME, IDX, SEQ_NUM, VALUE (which correspond to name, idx and value
+respectively contain the sorting criterium for any array asked for). Of course,
+this view contains a lookup in various tables that hold only specific data sets
+and to supply these is a vast field not yet made applicable for normal users.
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+  The only data yet contained in the database are not very structured. Thus,
+developing power has to be invested largely to work out the different database
+tables and their content rather than looking for bugs (which I have not
+disvovered up to now). Anyhow:
+
+Please send bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
index 41c000fe1ca3d209d0a25d466fabd9cf20902e56..9baaf93e24e8b9d9c4c595b7efa62be6ccf54fd0 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PARAM_H
 #define PARAM_H
 
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
 #define PARAM_MAX_VALUE_LEN 128
 #define PARAM_MAX_NAME_LEN 128
 
index 3f1bd107ccb6835f19505cc448bae7368b18618d..4cc1a84f7aab6673eb55fb7fa62776876026832c 100644 (file)
@@ -17,8 +17,8 @@ static void Param_strerror(const Param *, const char *);
 int conParam(Param *my)
 {
        my->strerror = NULL;
-       my->user = "daq@db-hades.gsi.de";
-       my->passwd = "daqall";
+       my->user = "hades@db-hades.gsi.de";
+       my->passwd = "hades";
        return 0;
 }
 
@@ -50,7 +50,7 @@ int Param_getIntArray(const Param *my, const char *name, const char *idx, int ma
        const char* pw;
        char sqlname[PARAM_MAX_NAME_LEN];
        char sqlidx[PARAM_MAX_NAME_LEN];
-       char value[PARAM_MAX_NVALS][PARAM_MAX_VALUE_LEN];
+       char value[PARAM_MAX_ARRAY_LEN][PARAM_MAX_VALUE_LEN];
        EXEC SQL END DECLARE SECTION;
 
        for(i = 0 ; i <= strlen(name) ; i++) {
@@ -101,7 +101,7 @@ int Param_getStringArray(const Param *my, const char *name, const char *idx, int
        const char* pw;
        char sqlname[PARAM_MAX_NAME_LEN];
        char sqlidx[PARAM_MAX_NAME_LEN];
-       char value[PARAM_MAX_NVALS][PARAM_MAX_VALUE_LEN];
+       char value[PARAM_MAX_ARRAY_LEN][PARAM_MAX_VALUE_LEN];
        EXEC SQL END DECLARE SECTION;
 
        for(i = 0 ; i <= strlen(name) ; i++) {
diff --git a/allParam/psql/README b/allParam/psql/README
new file mode 100644 (file)
index 0000000..601504e
--- /dev/null
@@ -0,0 +1,55 @@
+Author:  Benjamin Sailer
+         TUM/E12
+         Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date:    2000-09-10
+
+libpsqlParam.a
+==============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirments
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+  The PostgreSQL frontend header used here (which is delivered with the
+posrgresql-devel package on actual Linux distributions) is called libpq-fe.h
+and was found in /usr/include/pgsql on my system. As libpsqlParam.a was only
+developed as a side path and is not really useful for the broad hades collab,
+I didn't loos time investigating the situation on other os' or only other
+distributions.
+
+2. Linktime requirments
+-----------------------
+
+  According to the above said, there is also no information available where to
+find the libpq.[a|so] and the libcrypt.[a|so] on the diverse systems while at
+redhat 6.0 they can be found in the normal library search path (/usr/lib).
+
+3. Runtime requirments
+----------------------
+
+  libpsqlParam.a will try to open a connection to a postgres database located
+on casino.e12.physik.tu-muenchen.de and called 'hadaq'. Note that actual data
+are not likely to be available there, but the testing enviroment should be
+in the current setup. 
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+  As a testing object for independent database connections, libpsqlParam.a is
+not rcommended for use at normal runtime. Anyway, if developing database
+concepts on another machine with a tiny free database is wanted, libpsqlParam.a
+can be a good choice together with some changes to the source code. So if you
+are interested in libpsqlParam.a:
+
+Please send bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
index fe2190993113715adfa8a843a2f94fe4783c7d80..a847c05db4312d3b13f9ed01113d31a0b7d7913b 100644 (file)
@@ -51,7 +51,7 @@ int Param_getIntArray(const Param *my, const char *name, const char *idx, int ma
        }
 
        *rows = 0;
-       conn = PQconnectdb("host=casino dbname=bsailer user=bsailer");
+       conn = PQconnectdb("host=casino.e12.physik.tu-muenchen.de dbname=hadaq user=bsailer");
        sprintf(whereClause, "WHERE name = '%s' AND idx = '%s' ", lname, lidx);
        sprintf(query, "SELECT * FROM card_params %s UNION SELECT * FROM cpus %s UNION SELECT * FROM crate_params %s UNION SELECT * FROM crate_setup %s ORDER BY seq_num;", whereClause, whereClause, whereClause, whereClause);
 
index d7e9ea68d5094c9fde4d37f6f16f8767ce38144e..6f4031fbc67a6f833f873564ee552422339911d4 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PARAM_H
 #define PARAM_H
 
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
 #define PARAM_MAX_VALUE_LEN 128
 #define PARAM_MAX_NAME_LEN 128
 
diff --git a/allParam/tcl/README b/allParam/tcl/README
new file mode 100644 (file)
index 0000000..0b844a1
--- /dev/null
@@ -0,0 +1,72 @@
+Author:  Benjamin Sailer
+         TUM/E12
+         Benjamin.Sailer@ph.tum.de
+Version: 0.1
+Date:    2000-09-10
+
+libtclParam.a
+=============
+
+Content
+-------
+
+1. Compiletime requirements
+2. Linktime requirments
+3. Runtime requirments
+4. Known bugs and further developement perspectives
+
+1. Compiletime requirements
+---------------------------
+
+  At compiletime the only requirement for libtclParam.a is tcl.h, which should
+be available on most UNIX systems in the default include path.
+
+2. Linktime requirments
+-----------------------
+
+  The library needs libtcl.a (or libtcl.so), which is normally located in the
+defaut library path ('/usr/lib'). Anyhow, on some systems (like GSI Linux
+cluster) there is no link from the actual version of the tcl library (somthing
+like libtcl8.0.so) set to libtcl.so which forces you to change the Makefile in
+that respect. Additionally sometimes there seems to be no static library but
+only a shared object - which must not, but can, cause trouble if required other
+libraries are not available (such as libm.a or libdl.a).
+
+3. Runtime requirments
+----------------------
+
+  libtclParam.a starts a tcl-interpreter the input file of which has - of
+course - to be a tcl file. The library looks up for the enviroment variable
+DAQSLOW_PARAM_FILE and tries to open the file pointed to by it. If the variable
+is not defined, libtclParam.a looks for param.tcl in the working directory. The
+simple syntax of the tcl-file is just
+set <name>(<idx>) <value>
+(where <idx> is either the supplied idx string or the latter combined with a
+decimal representing the sequence number within an array). <name> and <value>
+are their corresponting values of the param function call.
+
+4. Known bugs and further developement perspectives
+---------------------------------------------------
+
+  In the tcl file, arrays are only recognized up to the size where the first
+sequence number is missing (this is due to performance reasons). For example
+card0(threshold0) 7
+card0(threshold1) 4
+card0(threshold2) 6
+card0(threshold3) 7
+card0(threshold4) 9
+card0(threshold6) 8
+card0(threshold7) 6
+card0(threshold8) 7
+will only return the first 4 threshold values, if requested via
+Param_getIntArray(param, "card0", "threshold", 8, &rows, value);
+In this respect, libtclParam.a (and also libfileParam.a) have a different
+behaviour than the database oriented param sources (that return all values,
+while the index of the single value is lost). Both behaviors are not the best
+ways and will hopefully be canged to a third one, in which a placeholder value
+is sent for all missing values. As in all READMEs, my request to you is:
+
+Please send additional bug reports to
+
+Benjamin.Sailer@ph.tum.de
+
index 69fae6c8ee4770007c9fc43e88c521ff6d04308d..c76be3d7a19381dc7a9b2f2aee4a78782845469d 100644 (file)
@@ -57,7 +57,7 @@ int Param_getIntArray(const Param *my, const char *name, const char *idx, int ma
        int retVal = 0;
        int i;
        char *endptr;
-       char *strval[PARAM_MAX_NVALS];
+       char *strval[PARAM_MAX_ARRAY_LEN];
 
        for (i = 0 ; i < maxrows ; i++) {
                strval[i] = malloc(PARAM_MAX_VALUE_LEN * sizeof(char));
index 003ba05d10d6510d401ccca925cd36fcf8356174..6f177bd9807aa344e82412218d7c8653ed57607b 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef PARAM_H
 #define PARAM_H
 
-#define PARAM_MAX_NVALS 1024
+#define PARAM_MAX_ARRAY_LEN 128
 #define PARAM_MAX_VALUE_LEN 128
 #define PARAM_MAX_NAME_LEN 128