Commit 1f102f8c authored by Curtis Rose's avatar Curtis Rose
Browse files

Changed an error message in mroctx2isis to be more specific with various user errors. Fixes #1004.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6907 41f8697f-d340-4b68-9986-7bafba869bb8
parent a0e67753
Loading
Loading
Loading
Loading
+36 −21
Original line number Diff line number Diff line
@@ -35,10 +35,19 @@ void IsisMain() {
  IString id, bitMode;
  int sumMode, editMode;
  bool projected;

  {
    QString msg;
    try {
      msg = "File could not be opened.";
      Pvl lab(inFile.expanded());

      msg = "PVL Keyword [DATA_SET_ID] not found in label.";
      id = (QString) lab.findKeyword("DATA_SET_ID");
      projected = lab.hasObject("IMAGE_MAP_PROJECTION");

      msg = "PVL Keywords [SPATIAL_SUMMING] and [SAMPLING_FACTOR] not found in label.";
      msg += "The mroctx2isis application requires at least one to exist in order to set summing mode.";
      if(lab.hasKeyword("SPATIAL_SUMMING")) {
        sumMode = (int)lab.findKeyword("SPATIAL_SUMMING");
      }
@@ -46,21 +55,26 @@ void IsisMain() {
        sumMode = (int)lab.findKeyword("SAMPLING_FACTOR");
      }

      msg = "PVL Keyword [SAMPLE_BIT_MODE_ID] not found in label.";
      bitMode = (QString) lab.findKeyword("SAMPLE_BIT_MODE_ID");

      msg = "PVL Keywords [EDIT_MODE_ID] and [SAMPLE_FIRST_PIXEL] not found in label.";
      msg += "The mroctx2isis application requires at least one to exist in order to set edit mode.";
      if(lab.hasKeyword("EDIT_MODE_ID")) {
        editMode = (int)lab.findKeyword("EDIT_MODE_ID");
      }
      else {
        editMode = (int)lab.findKeyword("SAMPLE_FIRST_PIXEL");
      }

    }
    catch(IException &e) {
    QString msg = "Unable to read [DATA_SET_ID] from input file [" +
                  inFile.expanded() + "]";
    throw IException(IException::Unknown, msg, _FILEINFO_);
      throw IException(e, IException::Unknown, msg, _FILEINFO_);
    }
  }




  //Checks if in file is rdr
  if(projected) {
    QString msg = "[" + inFile.name() + "] appears to be an rdr file.";
@@ -137,6 +151,7 @@ void IsisMain() {
        suf = 0;
      }
    }
    ui.PutInteger("SUFFIX", suf);
  }
  p.SetDataPrefixBytes(endPix + 1);
  p.SetDataSuffixBytes(suf);
+4 −0
Original line number Diff line number Diff line
@@ -46,6 +46,10 @@
        <change name="Steven Lambright" date="2008-09-02">
          Fixed bug where dark current data could be corrupted if FILLGAP was true
        </change>
        <change name="Curtis Rose" date="2016-06-10">
          Fixed bug where program would get stuck in an infinite loop when a cube
          was smaller than 10 in either lines or samples
        </change>
    </history>

    <category>