diff --git a/NEWS b/NEWS index bd73fb398e2f07c3127721525251ab17b43abfa8..0924e66a2b1d235b2a09b17fb78532883cef5f2f 100644 --- a/NEWS +++ b/NEWS @@ -10,6 +10,7 @@ Changes for X.X - Bug Fix (1010): Prevent divide-by-zero error in daqd filesys.hh - Bug Fix (513): Cleanup debug schemes. Also created separate udp_rcvr files, fixed mx_rcvr header - Bug Fix (1015): Update daqd,nds build for ldas-tools 2.5 +- Bug Fix (1022): Allow dataviewer to display trends of double precision channels. ================================================================================================== Changes for 3.0.3 ================================================================================================== diff --git a/src/dv/Makefile b/src/dv/Makefile index 6f2e234fe2d8ec304194998641cfade6ac36a362..d96317a3e40d9b62c15421b68e243705daa91e78 100644 --- a/src/dv/Makefile +++ b/src/dv/Makefile @@ -1,7 +1,7 @@ # Dataviewer Makefile # Dataviewer 'version' -VERSION=3.0 +VERSION=3.0.4 # Installation Location INSTALL_PREFIX=/ligo/apps diff --git a/src/dv/Th/datasrv.c b/src/dv/Th/datasrv.c index 76b16b72b57be975db30bc15bd08c0339dd706f7..dabb7493d4ee7078102782042e5934bbefb884c3 100644 --- a/src/dv/Th/datasrv.c +++ b/src/dv/Th/datasrv.c @@ -41,7 +41,10 @@ short Fast = 1; /* 1 or 16 */ /* Debug fprintf(). */ void dfprintf(FILE *file, ...) {} -double bsdouble(double in) { +#if __BYTE_ORDER == __LITTLE_ENDIAN + +inline +double ntohd(double in) { double retVal; char* p = (char*)&retVal; char* i = (char*)∈ @@ -57,6 +60,9 @@ double bsdouble(double in) { return retVal; } +#else +#define ntohd(a) a +#endif /* int DataConnect(char* serverName, int serverPort, int lPort, void* read_data()) */ /* JCB */ @@ -687,8 +693,7 @@ int seconds; break; case 5: /* 64 bit-double */ for ( j=0; j<channelAll[index].rate/Fast; j++ ) { - data[j] = *((double *)(DataDaq.tb->data+pos+j*sizeof(double))); - data[j] = bsdouble(data[j]); + data[j] = ntohd(*((double *)(DataDaq.tb->data+pos+j*sizeof(double)))); } break; case 2: /* 32 bit-integer */ @@ -762,8 +767,7 @@ int seconds; case 5: /* 64 bit-double */ for ( j=0; j<chanList[index].rate/Fast; j++ ) { if (DataDaq.tb_size >= pos+j*sizeof(double)) { - data[j] = *((double *)(DataDaq.tb->data+pos+j*sizeof(double))); - data[j] = bsdouble(data[j]); + data[j] = ntohd(*((double *)(DataDaq.tb->data+pos+j*sizeof(double)))); } } break; @@ -791,29 +795,6 @@ int seconds; } } -#if __BYTE_ORDER == __LITTLE_ENDIAN - -inline -double ntohd(double in) { - double retVal; - char* p = (char*)&retVal; - char* i = (char*)∈ - p[0] = i[7]; - p[1] = i[6]; - p[2] = i[5]; - p[3] = i[4]; - - p[4] = i[3]; - p[5] = i[2]; - p[6] = i[1]; - p[7] = i[0]; - - return retVal; -} -#else -#define ntohd(a) a -#endif - int DataTrendGetCh(const char* chName, struct DTrend *trend) { int j, index, pos, typesize; @@ -917,9 +898,9 @@ int seconds, secrate; break; case 5: /* 64 bit-double */ for ( j=0; j<secrate; j++ ) { - (trend+j)->min = *((double *)( DataDaq.tb->data + pos +j*sizeof(double) )); - (trend+j)->max = *((double *)( DataDaq.tb->data + pos + sizeof(double)*secrate + j*sizeof(double) )); - (trend+j)->mean = *((double *)( DataDaq.tb->data + pos + 2*sizeof(double)*secrate + j*2*sizeof(double) )); + (trend+j)->min = ntohd(*((double *)( DataDaq.tb->data + pos +j*sizeof(double) ))); + (trend+j)->max = ntohd(*((double *)( DataDaq.tb->data + pos + sizeof(double)*secrate + j*sizeof(double) ))); + (trend+j)->mean = ntohd(*((double *)( DataDaq.tb->data + pos + 2*sizeof(double)*secrate + j*2*sizeof(double) ))); (trend+j)->mean = 0; } break;