Changeset 23352 for branches/cnb_branches/cnb_branch_20090301/ppStats/src
- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 5 edited
-
. (modified) (1 prop)
-
ppStats/src/Makefile.am (modified) (1 diff)
-
ppStats/src/ppStats.h (modified) (2 diffs)
-
ppStats/src/ppStatsFromMetadataPrint.c (modified) (2 diffs)
-
ppStats/src/ppStatsVersion.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/cnb_branches/cnb_branch_20090301
-
Property svn:mergeinfo
set to (toggle deleted branches)
/trunk merged eligible /branches/eam_branches/eam_branch_20090303 23158-23228
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
branches/cnb_branches/cnb_branch_20090301/ppStats/src/Makefile.am
r19626 r23352 1 1 lib_LTLIBRARIES = libppStats.la 2 libppStats_la_CFLAGS = $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) 2 3 # PPSTATS_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PPSTATS_BRANCH=`if [ -e ../../BRANCH ]; then cat ../../BRANCH; else svn info | sed -n -e '/URL:/ h' -e '/Repository Root:/ { x; H; x; s|Repository Root: \(.*\)\nURL: \1\(.*\)|\2| ; s|^/|| ; s|/[a-zA-Z]*/src.*|| ; p }'; fi` 5 # PPSTATS_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 # 7 # # Force recompilation of ppStatsVersion.c, since it gets the version information 8 # ppStatsVersion.c: FORCE 9 # touch ppStatsVersion.c 10 # FORCE: ; 11 12 libppStats_la_CFLAGS = $(PPSTATS_CFLAGS) $(PSMODULE_CFLAGS) $(PSLIB_CFLAGS) -DPPSTATS_VERSION=$(SVN_VERSION) -DPPSTATS_BRANCH=$(SVN_BRANCH) -DPPSTATS_SOURCE=$(SVN_SOURCE) 3 13 libppStats_la_LDFLAGS = $(PPSTATS_LIBS) $(PSMODULE_LIBS) $(PSLIB_LIBS) 4 14 -
branches/cnb_branches/cnb_branch_20090301/ppStats/src/ppStats.h
r21183 r23352 22 22 psList *summary; // Summary statistics to calculate 23 23 // Options for input data 24 bool doFirstReadout3D; // for 3D data, use the first readout?24 bool doFirstReadout3D; // for 3D data, use the first readout? 25 25 float sample; // Fraction of cell to sample for statistics 26 psImageMaskType maskVal; // Mask value for images26 psImageMaskType maskVal; // Mask value for images 27 27 psList *chips; // Chips to look at 28 28 psList *cells; // Cells to look at … … 108 108 psString ppStatsVersion(void); 109 109 110 /// Return source information 111 psString ppStatsSource(void); 112 110 113 /// Return long version information 111 114 psString ppStatsVersionLong(void); 115 116 /// Populate header with version information 117 bool ppStatsVersionHeader( 118 psMetadata *header ///< Header to populate 119 ); 120 112 121 113 122 void p_ppStatsGetMetadata(psMetadata *target, // Target for metadata -
branches/cnb_branches/cnb_branch_20090301/ppStats/src/ppStatsFromMetadataPrint.c
r20305 r23352 41 41 VALUE_NUMERICAL_CASE(F64, "lf", F64); 42 42 case PS_DATA_STRING: 43 fprintf(f, "%s '%s' ", entry->flag, entry->value->data.str); 43 if (entry->value->data.str) { 44 fprintf(f, "%s '%s' ", entry->flag, entry->value->data.str); 45 } 44 46 break; 45 47 case PS_DATA_BOOL: … … 50 52 case PS_DATA_TIME: { 51 53 psTime *t = (psTime*)entry->value->data.V; 52 psString str = psTimeToISO(t); 53 fprintf(f, "%s %.19sZ ", entry->flag, str); 54 psFree(str); 54 if (t) { 55 psString str = psTimeToISO(t); 56 fprintf(f, "%s %.19sZ ", entry->flag, str); 57 psFree(str); 58 } 55 59 break; 56 60 } -
branches/cnb_branches/cnb_branch_20090301/ppStats/src/ppStatsVersion.c
r13993 r23352 1 1 #include "ppStatsInternal.h" 2 2 3 static const char *cvsTag = "$Name: not supported by cvs2svn $";// CVS tag name 3 #ifndef PPSTATS_VERSION 4 #error "PPSTATS_VERSION is not set" 5 #endif 6 #ifndef PPSTATS_BRANCH 7 #error "PPSTATS_BRANCH is not set" 8 #endif 9 #ifndef PPSTATS_SOURCE 10 #error "PPSTATS_SOURCE is not set" 11 #endif 12 13 #define xstr(s) str(s) 14 #define str(s) #s 4 15 5 16 psString ppStatsVersion(void) 6 17 { 7 psString version = NULL; // Version, to return 8 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 9 return version; 18 char *value = NULL; 19 psStringAppend(&value, "%s@%s", xstr(PPSTATS_BRANCH), xstr(PPSTATS_VERSION)); 20 return value; 21 } 22 23 psString ppStatsSource(void) 24 { 25 return psStringCopy(xstr(PPSTATS_SOURCE)); 10 26 } 11 27 12 28 psString ppStatsVersionLong(void) 13 29 { 14 psString version = ppStatsVersion(); // Version, to return 15 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 16 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); 17 psFree(tag); 30 psString version = ppStatsVersion(); // Version, to return 31 psString source = ppStatsSource(); // Source 32 33 psStringPrepend(&version, "ppStats "); 34 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 35 psFree(source); 36 37 #ifdef __OPTIMIZE__ 38 psStringAppend(&version, " optimised"); 39 #else 40 psStringAppend(&version, " unoptimised"); 41 #endif 42 18 43 return version; 44 }; 45 46 bool ppStatsVersionHeader(psMetadata *header) 47 { 48 PS_ASSERT_METADATA_NON_NULL(header, false); 49 50 psString version = ppStatsVersion(); // Software version 51 psString source = ppStatsSource(); // Software source 52 53 psStringPrepend(&version, "ppStats version: "); 54 psStringPrepend(&source, "ppStats source: "); 55 56 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, version); 57 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, source); 58 59 psFree(version); 60 psFree(source); 61 62 return true; 19 63 }
Note:
See TracChangeset
for help on using the changeset viewer.
