Commit 8e8e4590 authored by miller86's avatar miller86
Browse files

RC->Trunk: fixing a couple of bad behaviors of Velodyne plugin

git-svn-id: http://visit.ilight.com/svn/visit/trunk/src@12809 18c085ea-50e0-402c-830e-de6fd14e8384
parent 0a75b53a
......@@ -17,9 +17,16 @@ using std::cout;
#include <VelodyneReader.h>
//
// Modifications:
// Mark C. Miller, Mon Oct 25 17:17:50 PDT 2010
// Added call to H5Eset_auto to silence output on stderr.
//
int VelodyneReader::
open( const char* filename )
{
H5Eset_auto(H5E_DEFAULT , 0, 0);
file_id = H5Fopen( filename, H5F_ACC_RDONLY, H5P_DEFAULT );
if( file_id<0 ) {
debug1 << "Failed to open Velodyne plot file: " << filename << ".\n";
......
......@@ -177,6 +177,11 @@ GetTime()
// Programmer: hpan -- generated by xml2avt
// Creation: Thu Aug 7 11:38:59 PDT 2008
//
// Modifications:
// Mark C. Miller, Mon Oct 25 17:16:50 PDT 2010
// Added calls to close the file. Otherwise, file is left open in HDF5
// and some other poor HDF5 plugin that comes along after Velodyne excpets
// winds up being unable to open the file.
// ****************************************************************************
avtVelodyneFileFormat::avtVelodyneFileFormat(const char *filename)
......@@ -187,14 +192,17 @@ avtVelodyneFileFormat::avtVelodyneFileFormat(const char *filename)
reader_ = new VelodyneReader();
int ierr = reader_->open(filename);
if( ierr==-1 ) {
reader_->close();
EXCEPTION1(InvalidDBTypeException,
"The file could not be opened");
}
if( ierr==-2 ) {
reader_->close();
EXCEPTION1(InvalidDBTypeException,
"The file does not contain valid groups");
}
if( ierr<0 ) {
reader_->close();
EXCEPTION1(InvalidDBTypeException,
"The file does not have valid meshes");
}
......@@ -210,6 +218,7 @@ avtVelodyneFileFormat::avtVelodyneFileFormat(const char *filename)
avtVelodyneFileFormat::~avtVelodyneFileFormat()
{
debug2 << "closed avtVelodyneFileFormat\n.";
reader_->close();
delete reader_;
if( map_ ) { delete [] map_; map_=NULL; }
if( crd_ ) { crd_->Delete(); crd_=NULL; }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment