Changeset 16344
- Timestamp:
- Feb 6, 2008, 2:09:40 PM (18 years ago)
- Location:
- trunk/psModules/src/camera
- Files:
-
- 2 edited
-
pmFPAfileIO.c (modified) (2 diffs)
-
pmFPAfileIO.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psModules/src/camera/pmFPAfileIO.c
r16257 r16344 914 914 // set the state of the specified pmFPAfile to active (state == true) or inactive 915 915 // if name is NULL, set the state for all pmFPAfiles 916 bool pmFPAfileActivate (psMetadata *files, bool state, c har *name)916 bool pmFPAfileActivate (psMetadata *files, bool state, const char *name) 917 917 { 918 918 PS_ASSERT_PTR_NON_NULL(files, false); … … 963 963 return true; 964 964 } 965 966 967 pmFPAfile *pmFPAfileActivateSingle(psMetadata *files, bool state, const char *name, int num) 968 { 969 PS_ASSERT_PTR_NON_NULL(files, NULL); 970 PS_ASSERT_STRING_NON_EMPTY(name, NULL); 971 PS_ASSERT_INT_NONNEGATIVE(num, NULL); 972 973 psString regex = NULL; // Regular expression for psMetadataIteratorAlloc 974 psStringAppend(®ex, "^%s$", name); 975 976 int i = 0; // Counter 977 psMetadataItem *item = NULL; // Item from iteration 978 psMetadataIterator *iter = psMetadataIteratorAlloc(files, PS_LIST_HEAD, regex); // Iterator 979 psFree(regex); 980 while ((item = psMetadataGetAndIncrement(iter))) { 981 if (i++ == num) { 982 pmFPAfile *file = item->data.V; // File of interest 983 if (state) { 984 file->state &= PS_NOT_U8(PM_FPA_STATE_INACTIVE); 985 } else { 986 file->state |= PM_FPA_STATE_INACTIVE; 987 } 988 psFree(iter); 989 return file; 990 } 991 } 992 psFree(iter); 993 return NULL; 994 } -
trunk/psModules/src/camera/pmFPAfileIO.h
r12832 r16344 3 3 * 4 4 * @author EAM, IfA 5 * @author PAP, IfA 5 6 * 6 * @version $Revision: 1. 6$ $Name: not supported by cvs2svn $7 * @date $Date: 200 7-04-14 03:22:47$7 * @version $Revision: 1.7 $ $Name: not supported by cvs2svn $ 8 * @date $Date: 2008-02-07 00:09:40 $ 8 9 * Copyright 2004-2005 Institute for Astronomy, University of Hawaii 9 10 */ … … 34 35 // set the state of the specified pmFPAfile to active (state == true) or inactive 35 36 // if name is NULL, set the state for all pmFPAfiles 36 bool pmFPAfileActivate (psMetadata *files, bool state, char *name); 37 bool pmFPAfileActivate (psMetadata *files, bool state, const char *name); 38 39 /// Set the state of a single pmFPAfile (in the case of multiple files with the same name) 40 /// 41 /// Returns file activated 42 pmFPAfile *pmFPAfileActivateSingle(psMetadata *files, ///< Files to activate 43 bool state, ///< State to set 44 const char *name, ///< Name of file to activate 45 int num ///< Sequence numbner of file to activate 46 ); 37 47 38 48 // examine all pmFPAfiles listed in the files and perform the needed I/O operations (open,read,write,close)
Note:
See TracChangeset
for help on using the changeset viewer.
