Changeset 23352 for branches/cnb_branches/cnb_branch_20090301/ppArith/src
- Timestamp:
- Mar 17, 2009, 12:08:50 PM (17 years ago)
- Location:
- branches/cnb_branches/cnb_branch_20090301
- Files:
-
- 6 edited
-
. (modified) (1 prop)
-
ppArith/src/Makefile.am (modified) (1 diff)
-
ppArith/src/ppArith.c (modified) (1 diff)
-
ppArith/src/ppArith.h (modified) (4 diffs)
-
ppArith/src/ppArithLoop.c (modified) (1 diff)
-
ppArith/src/ppArithVersion.c (modified) (2 diffs)
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/ppArith/src/Makefile.am
r15571 r23352 1 1 bin_PROGRAMS = ppArith 2 ppArith_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPARITH_CFLAGS) 2 3 # PPARITH_VERSION=`if [ -e ../../VERSION ]; then cat ../../VERSION; else svnversion; fi` 4 # PPARITH_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 # PPARITH_SOURCE=`if [ -e ../../SOURCE ]; then cat ../../SOURCE; else svn info | sed -n -e 's/Repository UUID: // p'; fi` 6 # 7 # # Force recompilation of ppArithVersion.c, since it gets the version information 8 # ppArithVersion.c: FORCE 9 # touch ppArith.c 10 # FORCE: ; 11 12 ppArith_CPPFLAGS = $(PSLIB_CFLAGS) $(PSMODULE_CFLAGS) $(PPSTATS_CFLAGS) $(PSPHOT_CFLAGS) $(PPARITH_CFLAGS) -DPPARITH_VERSION=$(SVN_VERSION) -DPPARITH_BRANCH=$(SVN_BRANCH) -DPPARITH_SOURCE=$(SVN_SOURCE) 3 13 ppArith_LDFLAGS = $(PSLIB_LIBS) $(PSMODULE_LIBS) $(PPSTATS_LIBS) $(PSPHOT_LIBS) $(PPARITH_LIBS) 4 14 -
branches/cnb_branches/cnb_branch_20090301/ppArith/src/ppArith.c
r21378 r23352 34 34 } 35 35 36 ppArithVersionPrint(); 37 36 38 if (!ppArithArguments(argc, argv, config)) { 37 39 psErrorStackPrint(stderr, "Error reading arguments.\n"); -
branches/cnb_branches/cnb_branch_20090301/ppArith/src/ppArith.h
r21244 r23352 22 22 * Parse the arguments 23 23 */ 24 bool ppArithArguments(int argc, char *argv[], ///< Command-line arguments 25 pmConfig *config ///< Configuration 24 bool ppArithArguments(int argc, char *argv[], ///< Command-line arguments 25 pmConfig *config ///< Configuration 26 26 ); 27 27 … … 29 29 * Parse the camera input 30 30 */ 31 bool ppArithCamera(pmConfig *config ///< Configuration 31 bool ppArithCamera(pmConfig *config ///< Configuration 32 32 ); 33 33 … … 35 35 * Loop over the FPA hierarchy 36 36 */ 37 bool ppArithLoop(pmConfig *config ///< Configuration 37 bool ppArithLoop(pmConfig *config ///< Configuration 38 38 ); 39 39 … … 41 41 * Perform arithmetic on the readout 42 42 */ 43 bool ppArithReadout(pmReadout *output, ///< Output readout 44 const pmReadout *input1, ///< Input readout 45 const pmReadout *input2, ///< Input readout 46 const pmConfig *config, ///< Configuration 47 const pmFPAview *view ///< View of readout on which to operate 43 bool ppArithReadout(pmReadout *output, ///< Output readout 44 const pmReadout *input1, ///< Input readout 45 const pmReadout *input2, ///< Input readout 46 const pmConfig *config, ///< Configuration 47 const pmFPAview *view ///< View of readout on which to operate 48 48 ); 49 49 50 50 /** 51 * Put the program version information into a metadata51 * Put the program version information into header 52 52 */ 53 void ppArithVersionMetadata(psMetadata *metadata ///< Metadatato populate53 bool ppArithVersionHeader(psMetadata *header ///< Header to populate 54 54 ); 55 56 /// Print version information 57 void ppArithVersionPrint(void); 55 58 56 59 ///@} -
branches/cnb_branches/cnb_branch_20090301/ppArith/src/ppArithLoop.c
r21378 r23352 113 113 hdu->header = psMetadataAlloc(); 114 114 } 115 ppArithVersion Metadata(hdu->header);115 ppArithVersionHeader(hdu->header); 116 116 lastHDU = hdu; 117 117 } -
branches/cnb_branches/cnb_branch_20090301/ppArith/src/ppArithVersion.c
r21378 r23352 22 22 #include "ppArith.h" 23 23 24 static const char *cvsTag = "$Name: not supported by cvs2svn $";///< CVS tag name 24 #ifndef PPARITH_VERSION 25 #error "PPARITH_VERSION is not set" 26 #endif 27 #ifndef PPARITH_BRANCH 28 #error "PPARITH_BRANCH is not set" 29 #endif 30 #ifndef PPARITH_SOURCE 31 #error "PPARITH_SOURCE is not set" 32 #endif 33 34 #define xstr(s) str(s) 35 #define str(s) #s 25 36 26 37 psString ppArithVersion(void) 27 38 { 28 psString version = NULL; // Version, to return 29 psStringAppend(&version, "%s-%s",PACKAGE_NAME,PACKAGE_VERSION); 30 return version; 39 char *value = NULL; 40 psStringAppend(&value, "%s@%s", xstr(PPARITH_BRANCH), xstr(PPARITH_VERSION)); 41 return value; 42 } 43 44 psString ppArithSource(void) 45 { 46 return psStringCopy(xstr(PPARITH_SOURCE)); 31 47 } 32 48 33 49 psString ppArithVersionLong(void) 34 50 { 35 psString version = ppArithVersion(); // Version, to return 36 psString tag = psStringStripCVS(cvsTag, "Name"); // CVS tag 37 psStringAppend(&version, " (cvs tag %s) %s, %s", tag, __DATE__, __TIME__); 38 psFree(tag); 51 psString version = ppArithVersion(); // Version, to return 52 psString source = ppArithSource(); // Source 53 54 psStringPrepend(&version, "ppArith "); 55 psStringAppend(&version, " from %s, built %s, %s", source, __DATE__, __TIME__); 56 psFree(source); 57 58 #ifdef __OPTIMIZE__ 59 psStringAppend(&version, " optimised"); 60 #else 61 psStringAppend(&version, " unoptimised"); 62 #endif 63 39 64 return version; 65 }; 66 67 bool ppArithVersionHeader(psMetadata *header) 68 { 69 PS_ASSERT_METADATA_NON_NULL(header, false); 70 71 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 72 psString timeString = psTimeToISO(time); // The time in an ISO string 73 psFree(time); 74 psString history = NULL; // History string 75 psStringAppend(&history, "ppArith at %s", timeString); 76 psFree(timeString); 77 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, history); 78 psFree(history); 79 80 psLibVersionHeader(header); 81 psModulesVersionHeader(header); 82 ppStatsVersionHeader(header); 83 84 psString version = ppArithVersion(); // Software version 85 psString source = ppArithSource(); // Software source 86 87 psStringPrepend(&version, "ppArith version: "); 88 psStringPrepend(&version, "ppArith source: "); 89 90 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, version); 91 psMetadataAddStr(header, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, NULL, source); 92 93 psFree(version); 94 psFree(source); 95 96 return true; 40 97 } 41 98 42 43 void ppArithVersionMetadata(psMetadata *metadata) 99 void ppArithVersionPrint(void) 44 100 { 45 PS_ASSERT_METADATA_NON_NULL(metadata,); 101 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 102 psString timeString = psTimeToISO(time); // The time in an ISO string 103 psFree(time); 104 psLogMsg("ppArith", PS_LOG_INFO, "ppArith at %s", timeString); 105 psFree(timeString); 46 106 47 107 psString pslib = psLibVersionLong();// psLib version … … 50 110 psString ppArith = ppArithVersionLong(); // ppArith version 51 111 52 psTime *time = psTimeGetNow(PS_TIME_TAI); // The time now 53 psString timeString = psTimeToISO(time); // The time in an ISO string 54 psFree(time); 55 psString head = NULL; // Head string 56 psStringAppend(&head, "ppArith processing at %s. Component information:", timeString); 57 psFree(timeString); 112 psLogMsg("ppArith", PS_LOG_INFO, "%s", pslib); 113 psLogMsg("ppArith", PS_LOG_INFO, "%s", psmodules); 114 psLogMsg("ppArith", PS_LOG_INFO, "%s", ppStats); 115 psLogMsg("ppArith", PS_LOG_INFO, "%s", ppArith); 58 116 59 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, head, "");60 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, pslib, "");61 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, psmodules, "");62 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, ppStats, "");63 psMetadataAddStr(metadata, PS_LIST_TAIL, "HISTORY", PS_META_DUPLICATE_OK, ppArith, "");64 65 psFree(head);66 117 psFree(pslib); 67 118 psFree(psmodules);
Note:
See TracChangeset
for help on using the changeset viewer.
