00001 #include "session.h" 00002 00006 bool Session::validate (ValidationReport * valRep) { 00007 bool dataValid = true ; 00008 std::stringstream rptstream ; 00009 00010 valRep->breakBegin( "Session data check..." ) ; 00011 00012 // RC ID: regional center ID 00013 if (mRC_ID <= 0) { 00014 valRep->reportError( "RC ID is incomplete or invalid." ) ; 00015 dataValid = false ; 00016 } 00017 00018 // Data Source: image path and filename 00019 if ( mDataSrc.empty() ) { 00020 valRep->reportError( "Data source is required." ) ; 00021 dataValid = false ; 00022 } 00023 00024 // Analyst's surname 00025 if ( manlst_surn.empty() ) { 00026 valRep->reportError( "Surname is required." ) ; 00027 dataValid = false ; 00028 } 00029 00030 // Analyst's given name 00031 if ( manlst_givn.empty() ) { 00032 valRep->reportError( "Given (first) name is required." ) ; 00033 dataValid = false ; 00034 } 00035 00036 // Processing description 00037 if ( mProcDesc.empty() ) { 00038 valRep->reportError( "Description of processing is required." ) ; 00039 dataValid = false ; 00040 } 00041 00042 // 3D analysis description 00043 if ( m3d_desc.empty() ) { 00044 valRep->reportWarning( "Description of how 3D information was derived is empty." ) ; 00045 } 00046 00047 // 3D analysis description 00048 if ( manaly_time.empty() ) { 00049 valRep->reportOkay( "Analysis time will be automatically filled in by GLIMSView when you export a GLIMS shapefile for ingestion to the GLIMS database." ) ; 00050 } 00051 00052 if (dataValid) { 00053 valRep->breakEnd( "SESSION INFORMATION CHECK COMPLETE: All session information filled in." ) ; 00054 } 00055 else { 00056 valRep->breakEnd( "SESSION INFORMATION ERROR: Missing required session information." ) ; 00057 } 00058 00059 // return status of lines 00060 return dataValid ; 00061 00062 }
Home |
Search |
Disclaimers & Privacy |
Contact Us GLIMSView Maintainer: dsoltesz@usgs.gov |