Changeset 11292
- Timestamp:
- Jan 25, 2007, 2:05:18 PM (19 years ago)
- Location:
- trunk/psModules
- Files:
-
- 9 edited
-
configure.ac (modified) (1 diff)
-
src/camera/pmFPA_JPEG.c (modified) (2 diffs)
-
src/camera/pmFPA_MANAPLOT.c (modified) (2 diffs)
-
src/camera/pmFPAfileDefine.c (modified) (4 diffs)
-
src/camera/pmFPAfileIO.c (modified) (1 diff)
-
src/config/pmConfig.c (modified) (5 diffs)
-
src/config/pmConfig.h (modified) (2 diffs)
-
src/objects/pmPSF_IO.c (modified) (3 diffs)
-
src/objects/pmSourceIO.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/configure.ac
r11253 r11292 323 323 PSMODULES_CFLAGS="${PSMODULES_CFLAGS=} ${PSLIB_CFLAGS}" 324 324 PSMODULES_LIBS="${PSMODULES_LIBS=} ${PSLIB_LIBS}" 325 326 dnl nebclient ----------------------------------------------------------------- 327 328 PKG_CHECK_MODULES([NEBCLIENT], [nebclient >= 0.0.2], 329 [AC_DEFINE([HAVE_NEBCLIENT], 1, [Define to 1 if libnebclient is avaiable])], [AC_MSG_RESULT([no])] 330 ) 331 332 PSMODULES_CFLAGS="${PSMODULES_CFLAGS=} ${NEBCLIENT_CFLAGS}" 333 PSMODULES_LIBS="${PSMODULES_LIBS=} ${NEBCLIENT_LIBS}" 325 334 326 335 echo "PSMODULES_CFLAGS: $PSMODULES_CFLAGS" -
trunk/psModules/src/camera/pmFPA_JPEG.c
r10883 r11292 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1.1 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-01- 03 03:18:21$7 * @version $Revision: 1.17 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-01-26 00:05:17 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 207 207 208 208 psString name = pmFPAfileNameFromRule (file->filerule, file, view); 209 psString newName = pmConfigConvertFilename (name, config); 209 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 210 psString newName = pmConfigConvertFilename(name, config, create); 210 211 211 212 psImageJpegColormap *map = psImageJpegColormapSet (NULL, colormapName); -
trunk/psModules/src/camera/pmFPA_MANAPLOT.c
r10421 r11292 5 5 * @author EAM, IfA 6 6 * 7 * @version $Revision: 1. 2$ $Name: not supported by cvs2svn $8 * @date $Date: 200 6-12-03 18:48:10$7 * @version $Revision: 1.3 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-01-26 00:05:17 $ 9 9 * 10 10 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 136 136 // output : filerule 137 137 138 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 139 138 140 psString tmpName; 139 141 tmpName = pmFPAfileNameFromRule (file->filextra, file, view); 140 psString input = pmConfigConvertFilename (tmpName, config );142 psString input = pmConfigConvertFilename (tmpName, config, create); 141 143 psFree (tmpName); 142 144 143 145 tmpName = pmFPAfileNameFromRule (file->filerule, file, view); 144 psString output = pmConfigConvertFilename (tmpName, config );146 psString output = pmConfigConvertFilename (tmpName, config, create); 145 147 psFree (tmpName); 146 148 147 149 tmpName = pmFPAfileNameFromRule (file->extname, file, view); 148 psString script = pmConfigConvertFilename (tmpName, config );150 psString script = pmConfigConvertFilename (tmpName, config, create); 149 151 psFree (tmpName); 150 152 -
trunk/psModules/src/camera/pmFPAfileDefine.c
r11255 r11292 286 286 } 287 287 288 psString realName = pmConfigConvertFilename (infiles->data[0], config); 288 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 289 psString realName = pmConfigConvertFilename (infiles->data[0], config, create); 289 290 if (!realName) { 290 291 psError(PS_ERR_IO, false, "Failed to convert file name %s\n", (char *) infiles->data[0]); … … 366 367 for (int i = 0; i < infiles->n; i++) { 367 368 if (i > 0) { 368 psString realName = pmConfigConvertFilename (infiles->data[i], config); 369 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 370 psString realName = pmConfigConvertFilename (infiles->data[i], config, create); 369 371 if (!realName) { 370 372 psError(PS_ERR_IO, false, "Failed to convert file name %s", (char *) infiles->data[i]); … … 490 492 // save the association on file->names 491 493 for (int i = 0; i < infiles->n; i++) { 492 psString realName = pmConfigConvertFilename (infiles->data[i], config); 494 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 495 psString realName = pmConfigConvertFilename (infiles->data[i], config, create); 493 496 if (!realName) { 494 497 psError(PS_ERR_IO, false, "Failed to convert file name %s", (char *) infiles->data[i]); … … 724 727 725 728 // Prepend the global path to the file rule 726 psString tmpName = pmConfigConvertFilename (file->filerule, config); 729 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 730 psString tmpName = pmConfigConvertFilename (file->filerule, config, create); 727 731 psFree (file->filerule); 728 732 file->filerule = tmpName; -
trunk/psModules/src/camera/pmFPAfileIO.c
r11255 r11292 239 239 240 240 // apply filename mangling rules (file://, path://, neb://) 241 psString tmpName = pmConfigConvertFilename (file->filename, config); 241 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 242 psString tmpName = pmConfigConvertFilename (file->filename, config, create); 242 243 psFree (file->filename); 243 244 file->filename = tmpName; -
trunk/psModules/src/config/pmConfig.c
r11245 r11292 4 4 * @author EAM (IfA) 5 5 * 6 * @version $Revision: 1.7 3$ $Name: not supported by cvs2svn $7 * @date $Date: 2007-01-2 3 03:19:35$6 * @version $Revision: 1.74 $ $Name: not supported by cvs2svn $ 7 * @date $Date: 2007-01-26 00:05:18 $ 8 8 * 9 9 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 24 24 #include <glob.h> 25 25 #include <pslib.h> 26 26 27 #include "pmConfig.h" 28 #include "pmErrorCodes.h" 27 29 #include "pmConfigRecipes.h" 28 30 #include "pmConfigCamera.h" 31 32 #ifdef HAVE_NEBCLIENT 33 #include <nebclient.h> 34 #endif // ifdef HAVE_NEBCLIENT 29 35 30 36 #define PS_SITE "PS_SITE" // Name of the environment variable containing the site config file … … 1047 1053 1048 1054 // convert the supplied name, create a new output psString 1049 psString pmConfigConvertFilename(const char *filename, const pmConfig *config )1055 psString pmConfigConvertFilename(const char *filename, const pmConfig *config, bool create) 1050 1056 { 1051 1057 PS_ASSERT_STRING_NON_EMPTY(filename, NULL); 1052 1058 PS_ASSERT_PTR_NON_NULL(config, NULL); 1053 1059 1054 psString newName = psStringCopy (filename);1055 1056 1060 // strip file:// from front of name 1057 if (!strncasecmp (newName, "file:", strlen("file:"))) { 1061 if (!strncasecmp(filename, "file:", strlen("file:"))) { 1062 psString newName = psStringCopy(filename); 1063 1058 1064 char *point = newName + strlen("file:"); 1059 1065 while (*point == '/') … … 1063 1069 psFree (newName); 1064 1070 newName = tmpName; 1071 1072 return newName; 1065 1073 } 1066 1074 1067 1075 // replace path://PATH with matched datapath 1068 if (!strncasecmp (newName, "path://", strlen("path://"))) {1076 if (!strncasecmp(filename, "path://", strlen("path://"))) { 1069 1077 PS_ASSERT_METADATA_NON_NULL(config->site, NULL); 1078 1079 psString newName = psStringCopy(filename); 1070 1080 1071 1081 // filename should be of the form: path://PATH/rest/of/file … … 1102 1112 psFree(newName); 1103 1113 newName = tmpName; 1114 1115 return newName; 1104 1116 } 1105 1117 1106 1118 // substitute neb://name with matched nebulous name 1107 1108 return newName; 1109 } 1119 if (!strncasecmp(filename, "neb://", strlen("neb://"))) { 1120 #ifdef HAVE_NEBCLIENT 1121 1122 bool status = false; 1123 psString nebulous_server = psMetadataLookupStr(&status, config->site, "NEBULOUS_SERVER"); 1124 if (!status) { 1125 psError(PM_ERR_CONFIG, true, "failed to lookup config value for NEBULOUS_SERVER."); 1126 return NULL; 1127 } 1128 if (!nebulous_server) { 1129 psError(PM_ERR_CONFIG, true, "Could not determine nebulous server URI."); 1130 return NULL; 1131 } 1132 1133 nebServer *server = nebServerAlloc(nebulous_server); 1134 if (!server) { 1135 psError(PM_ERR_SYS, true, "failed to create a nebServer object."); 1136 nebServerFree(server); 1137 return NULL; 1138 } 1139 1140 psString newName = psStringCopy(filename); 1141 1142 // for for the nebulous key 1143 char *foo = nebFind(server, newName); 1144 // if it doesn't exist, create it 1145 if (!foo) { 1146 foo = nebCreate(server, newName, 0, NULL, NULL, NULL); 1147 } 1148 1149 psFree(newName); 1150 psString newFoo = psStringCopy(foo); 1151 psFree(foo); 1152 nebServerFree(server); 1153 1154 return newFoo; 1155 1156 #else // ifdef HAVE_NEBCLIENT 1157 1158 psError(PM_ERR_PROG, true, "psModules was compiled without nebulous support."); 1159 return NULL; 1160 #endif // ifdef HAVE_NEBCLIENT 1161 1162 } 1163 1164 // if we go this far, do nothing 1165 return psStringCopy(filename); 1166 } -
trunk/psModules/src/config/pmConfig.h
r11251 r11292 5 5 * @author Eugene Magnier, IfA 6 6 * 7 * @version $Revision: 1.2 6$ $Name: not supported by cvs2svn $8 * @date $Date: 2007-01-2 4 01:05:41$7 * @version $Revision: 1.27 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2007-01-26 00:05:18 $ 9 9 * Copyright 2005-2006 Institute for Astronomy, University of Hawaii 10 10 */ … … 155 155 156 156 /// Convert the supplied name, create a new output psString 157 psString pmConfigConvertFilename(const char *filename, const pmConfig *config); 157 psString pmConfigConvertFilename( 158 const char *filename, ///< file path/URI 159 const pmConfig *config, ///< configuration 160 bool create ///< create the file if it doesn't exist 161 ); 158 162 159 163 /// Set whether all config parameters are read on startup -
trunk/psModules/src/objects/pmPSF_IO.c
r10421 r11292 6 6 * @author EAM, IfA 7 7 * 8 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $9 * @date $Date: 200 6-12-03 18:48:10$8 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 9 * @date $Date: 2007-01-26 00:05:18 $ 10 10 * 11 11 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 204 204 case PM_FPA_FILE_PSF: 205 205 filename = pmFPAfileNameFromRule (file->filerule, file, view); 206 realname = pmConfigConvertFilename (filename, config); 206 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 207 realname = pmConfigConvertFilename (filename, config, create); 207 208 208 209 psMetadata *psfData = pmPSFtoMetadata (NULL, psf); … … 308 309 case PM_FPA_FILE_PSF: 309 310 filename = pmFPAfileNameFromRule (file->filerule, file, view); 310 realname = pmConfigConvertFilename (filename, config); 311 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 312 realname = pmConfigConvertFilename (filename, config, create); 311 313 312 314 psMetadata *psfData = psMetadataConfigRead(NULL, &Nfail, realname, FALSE); -
trunk/psModules/src/objects/pmSourceIO.c
r11246 r11292 3 3 * @author EAM, IfA 4 4 * 5 * @version $Revision: 1.1 8$ $Name: not supported by cvs2svn $6 * @date $Date: 2007-01-2 3 03:20:13$5 * @version $Revision: 1.19 $ $Name: not supported by cvs2svn $ 6 * @date $Date: 2007-01-26 00:05:18 $ 7 7 * 8 8 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 182 182 return false; 183 183 184 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 185 184 186 switch (file->type) { 185 187 case PM_FPA_FILE_RAW: 186 188 filename = pmFPAfileNameFromRule (file->filerule, file, view); 187 realname = pmConfigConvertFilename (filename, config );189 realname = pmConfigConvertFilename (filename, config, create); 188 190 pmSourcesWriteRAW (sources, realname); 189 191 psFree (realname); … … 193 195 case PM_FPA_FILE_OBJ: 194 196 filename = pmFPAfileNameFromRule (file->filerule, file, view); 195 realname = pmConfigConvertFilename (filename, config );197 realname = pmConfigConvertFilename (filename, config, create); 196 198 pmSourcesWriteOBJ (sources, realname); 197 199 psFree (realname); … … 201 203 case PM_FPA_FILE_SX: 202 204 filename = pmFPAfileNameFromRule (file->filerule, file, view); 203 realname = pmConfigConvertFilename (filename, config );205 realname = pmConfigConvertFilename (filename, config, create); 204 206 pmSourcesWriteSX (sources, realname); 205 207 psFree (realname); … … 211 213 hdu = pmFPAviewThisHDU (view, file->fpa); 212 214 filename = pmFPAfileNameFromRule (file->filerule, file, view); 213 realname = pmConfigConvertFilename (filename, config );215 realname = pmConfigConvertFilename (filename, config, create); 214 216 215 217 // copy the header to an output header, add the output header data … … 452 454 } 453 455 454 psString realname = pmConfigConvertFilename (file->filename, config); 456 bool create = file->mode == PM_FPA_MODE_WRITE ? true : false; 457 psString realname = pmConfigConvertFilename (file->filename, config, create); 455 458 456 459 file->fits = psFitsOpen (realname, "r");
Note:
See TracChangeset
for help on using the changeset viewer.
