Index: /branches/czw_branch/20101203/dbconfig/changes.txt
===================================================================
--- /branches/czw_branch/20101203/dbconfig/changes.txt	(revision 29964)
+++ /branches/czw_branch/20101203/dbconfig/changes.txt	(revision 29965)
@@ -1990,2 +1990,4 @@
 
 -- Version 1.1.67
+
+ALTER TABLE rawImfile ADD column video_cells TINYINT AFTER burntool_state;
Index: /branches/czw_branch/20101203/dbconfig/raw.md
===================================================================
--- /branches/czw_branch/20101203/dbconfig/raw.md	(revision 29964)
+++ /branches/czw_branch/20101203/dbconfig/raw.md	(revision 29965)
@@ -141,3 +141,4 @@
     md5sum      STR         32
     burntool_state  S16     0
+    video_cells BOOL        f
 END
Index: /branches/czw_branch/20101203/ippTools/share/pxadmin_create_tables.sql
===================================================================
--- /branches/czw_branch/20101203/ippTools/share/pxadmin_create_tables.sql	(revision 29964)
+++ /branches/czw_branch/20101203/ippTools/share/pxadmin_create_tables.sql	(revision 29965)
@@ -251,4 +251,5 @@
     md5sum VARCHAR(32),
     burntool_state SMALLINT,
+    video_cells TINYINT DEFAULT 0,
     PRIMARY KEY(exp_id, class_id),
     KEY(tmp_class_id),
Index: /branches/czw_branch/20101203/ippTools/src/regtool.c
===================================================================
--- /branches/czw_branch/20101203/ippTools/src/regtool.c	(revision 29964)
+++ /branches/czw_branch/20101203/ippTools/src/regtool.c	(revision 29965)
@@ -499,5 +499,6 @@
     PXOPT_LOOKUP_S32(bytes, config->args,  "-bytes", false, false);
     PXOPT_LOOKUP_STR(md5sum, config->args, "-md5sum", false, false);
-
+    PXOPT_LOOKUP_Bool(video_cells, config->args, "-video_cells", false, false);
+    
     PXOPT_LOOKUP_S16(fault, config->args, "-fault", false, false);
     PXOPT_LOOKUP_S16(quality, config->args, "-quality", false, false);
@@ -572,4 +573,5 @@
         bytes,
         md5sum,
+	video_cells,
         0   // burntool_state
     )) {
Index: /branches/czw_branch/20101203/ippTools/src/regtoolConfig.c
===================================================================
--- /branches/czw_branch/20101203/ippTools/src/regtoolConfig.c	(revision 29964)
+++ /branches/czw_branch/20101203/ippTools/src/regtoolConfig.c	(revision 29965)
@@ -146,4 +146,5 @@
     ADD_OPT(S32,  addprocessedimfileArgs, "-bytes",          "define bytes",                0);
     ADD_OPT(S16,  addprocessedimfileArgs, "-burntool_state",        "set burntool state", 0);
+    ADD_OPT(Bool, addprocessedimfileArgs, "-video_cells",    "define if chip has video cells", false);
     ADD_OPT(S16,  addprocessedimfileArgs, "-fault",           "set fault code",                  0);
     ADD_OPT(S16,  addprocessedimfileArgs, "-quality",        "set quality flag", 0);
Index: /branches/czw_branch/20101203/ippconfig/gpc1/format_20080925.config
===================================================================
--- /branches/czw_branch/20101203/ippconfig/gpc1/format_20080925.config	(revision 29964)
+++ /branches/czw_branch/20101203/ippconfig/gpc1/format_20080925.config	(revision 29965)
@@ -235,4 +235,5 @@
         CELL.YPARITY    STR     ATM2_2
 
+	CHIP.VIDEOCELL  STR     CELLMODE
         # XY24 is bad, so get it from the database; all others from header
 	CHIP.TEMP.DEPEND	STR	CHIP.NAME
Index: /branches/czw_branch/20101203/ippconfig/gpc1/format_20080929.config
===================================================================
--- /branches/czw_branch/20101203/ippconfig/gpc1/format_20080929.config	(revision 29964)
+++ /branches/czw_branch/20101203/ippconfig/gpc1/format_20080929.config	(revision 29965)
@@ -230,4 +230,5 @@
         CELL.YPARITY    STR     ATM2_2
 
+	CHIP.VIDEOCELL  STR     CELLMODE
         # XY24 is bad, so get it from the database; all others from header
 	CHIP.TEMP.DEPEND	STR	CHIP.NAME
Index: /branches/czw_branch/20101203/ippconfig/gpc1/format_20081011.config
===================================================================
--- /branches/czw_branch/20101203/ippconfig/gpc1/format_20081011.config	(revision 29964)
+++ /branches/czw_branch/20101203/ippconfig/gpc1/format_20081011.config	(revision 29965)
@@ -221,4 +221,5 @@
         CELL.YPARITY    STR     ATM2_2
 
+	CHIP.VIDEOCELL  STR     CELLMODE
         # XY24 is bad, so get it from the database; all others from header
 	CHIP.TEMP.DEPEND	STR	CHIP.NAME
Index: /branches/czw_branch/20101203/ippconfig/gpc1/format_20090120.config
===================================================================
--- /branches/czw_branch/20101203/ippconfig/gpc1/format_20090120.config	(revision 29964)
+++ /branches/czw_branch/20101203/ippconfig/gpc1/format_20090120.config	(revision 29965)
@@ -209,4 +209,5 @@
 
         FPA.BURNTOOL.APPLIED STR BTOOLAPP
+	CHIP.VIDEOCELL  STR     CELLMODE
 
         FPA.PON.TIME    STR     PONTIME
Index: /branches/czw_branch/20101203/ippconfig/gpc1/format_20090220.config
===================================================================
--- /branches/czw_branch/20101203/ippconfig/gpc1/format_20090220.config	(revision 29964)
+++ /branches/czw_branch/20101203/ippconfig/gpc1/format_20090220.config	(revision 29965)
@@ -209,4 +209,5 @@
 
         FPA.BURNTOOL.APPLIED STR BTOOLAPP
+	CHIP.VIDEOCELL  STR     CELLMODE
 
         FPA.PON.TIME    STR     PONTIME
Index: /branches/czw_branch/20101203/ippconfig/gpc1/format_20100122.config
===================================================================
--- /branches/czw_branch/20101203/ippconfig/gpc1/format_20100122.config	(revision 29964)
+++ /branches/czw_branch/20101203/ippconfig/gpc1/format_20100122.config	(revision 29965)
@@ -209,4 +209,5 @@
 
         FPA.BURNTOOL.APPLIED STR BTOOLAPP
+	CHIP.VIDEOCELL  STR     CELLMODE
 
         FPA.PON.TIME    STR     PONTIME
Index: /branches/czw_branch/20101203/ippconfig/gpc1/format_orig.config
===================================================================
--- /branches/czw_branch/20101203/ippconfig/gpc1/format_orig.config	(revision 29964)
+++ /branches/czw_branch/20101203/ippconfig/gpc1/format_orig.config	(revision 29965)
@@ -217,4 +217,5 @@
 
         FPA.BURNTOOL.APPLIED STR BTOOLAPP
+	CHIP.VIDEOCELL  STR     CELLMODE
 
         FPA.PON.TIME    STR     PONTIME
Index: /branches/czw_branch/20101203/ippconfig/recipes/ppStats.config
===================================================================
--- /branches/czw_branch/20101203/ippconfig/recipes/ppStats.config	(revision 29964)
+++ /branches/czw_branch/20101203/ippconfig/recipes/ppStats.config	(revision 29965)
@@ -236,5 +236,8 @@
   CONCEPT       STR     FPA.BURNTOOL.APPLIED 
 
+
   CONCEPT       STR	FPA.PON.TIME    # time since last power on
+
+  CONCEPT       STR     CHIP.VIDEOCELL  
 
   STAT          STR     ROBUST_MEDIAN   # Background estimator
Index: /branches/czw_branch/20101203/ippconfig/recipes/ppStatsFromMetadata.config
===================================================================
--- /branches/czw_branch/20101203/ippconfig/recipes/ppStatsFromMetadata.config	(revision 29964)
+++ /branches/czw_branch/20101203/ippconfig/recipes/ppStatsFromMetadata.config	(revision 29965)
@@ -45,4 +45,5 @@
   ENTRY  VAL  FPA.PON.TIME     	  F32  CONSTANT          -pon_time            # time since last power on
 #  ENTRY  VAL  FPA.BURNTOOL.APPLIED S32 CONSTANT          -burntool_state      # 
+  ENTRY  VAL  CHIP.VIDEOCELL      BOOL CONSTANT          -video_cells         # This chip contains a video cell
   ENTRY  VAL  CHIP.TEMP        	  F32  SAMPLE_MEAN       -ccd_temp            # CCD temperature
   ENTRY  VAL  CELL.EXPOSURE    	  F32  SAMPLE_MEAN       -exp_time            # Exposure time
Index: /branches/czw_branch/20101203/psModules/src/concepts/pmConcepts.c
===================================================================
--- /branches/czw_branch/20101203/psModules/src/concepts/pmConcepts.c	(revision 29964)
+++ /branches/czw_branch/20101203/psModules/src/concepts/pmConcepts.c	(revision 29965)
@@ -249,5 +249,5 @@
 CONCEPT_REGISTER_FUNCTION(S32, Enum, -1); // For enums: set default to -1
 CONCEPT_REGISTER_FUNCTION(S32, S32, 0); // For values: set default to 0
-//CONCEPT_REGISTER_FUNCTION(Bool, Bool, NULL); // For values: set default to 0
+CONCEPT_REGISTER_FUNCTION(Bool, Bool, NULL); // For values: set default to 0
 
 static void conceptRegisterTime(const char *name, /* Name of concept */ \
@@ -353,4 +353,5 @@
         conceptRegisterStr("CHIP.ID", "Chip identifier", NULL, NULL, NULL, false, PM_FPA_LEVEL_CHIP);
         conceptRegisterF32("CHIP.SEEING", "Seeing FWHM (pixels)", NULL, NULL, NULL, false, PM_FPA_LEVEL_CHIP);
+	conceptRegisterBool("CHIP.VIDEOCELL", "Does this OTA have any video cells", p_pmConceptParse_VideoCell,NULL,NULL,false,PM_FPA_LEVEL_CHIP);
     }
 
Index: /branches/czw_branch/20101203/psModules/src/concepts/pmConceptsStandard.c
===================================================================
--- /branches/czw_branch/20101203/psModules/src/concepts/pmConceptsStandard.c	(revision 29964)
+++ /branches/czw_branch/20101203/psModules/src/concepts/pmConceptsStandard.c	(revision 29965)
@@ -737,4 +737,33 @@
     return psMetadataItemAllocS32(pattern->name, pattern->comment, binning);
 }
+
+// VIDEOCELLS
+psMetadataItem *p_pmConceptParse_VideoCell(const psMetadataItem *concept,
+					  const psMetadataItem *pattern,
+					  pmConceptSource source,
+					  const psMetadata *cameraFormat,
+					  const pmFPA *fpa,
+					  const pmChip *chip,
+					  const pmCell *cell)
+{
+  assert(concept);
+  assert(pattern);
+  bool has_video_cell = false;
+
+  if (concept->type != PS_DATA_STRING) {
+    psError(PS_ERR_BAD_PARAMETER_TYPE, true, "Type for %s (%x) is not string\n",
+	    concept->name, concept->type);
+    return NULL;
+  }
+
+  char *Vptr = strchr(concept->data.V,'V');
+  if (Vptr) {
+    has_video_cell = true;
+  }
+
+  return psMetadataItemAllocBool(pattern->name, pattern->comment, has_video_cell);
+}
+  
+   
 
 // BTOOLAPP
Index: /branches/czw_branch/20101203/psModules/src/concepts/pmConceptsStandard.h
===================================================================
--- /branches/czw_branch/20101203/psModules/src/concepts/pmConceptsStandard.h	(revision 29964)
+++ /branches/czw_branch/20101203/psModules/src/concepts/pmConceptsStandard.h	(revision 29965)
@@ -136,4 +136,15 @@
     );
 
+// Parse the CHIP.VIDEOCELL concept
+psMetadataItem *p_pmConceptParse_VideoCell(
+   const psMetadataItem *concept, ///< Concept to parse
+   const psMetadataItem *pattern, ///< Pattern to use in parsing
+   pmConceptSource source, ///< Source for concept
+   const psMetadata *cameraFormat, ///< Camera format definition
+   const pmFPA *fpa, ///< FPA for concept, or NULL
+   const pmChip *chip, ///< Chip for concept, or NULL
+   const pmCell *cell ///< Cell for concept, or NULL
+   );
+
 /// Format for the BTOOLAPP conceptn
 psMetadataItem *p_pmConceptParse_BTOOLAPP(
