Commit 3c279d01 authored by Curtis Rose's avatar Curtis Rose
Browse files

Fixed an error in hist where running the application from the command line...

Fixed an error in hist where running the application from the command line without a TO parameter entered, the application would process the histogram and then throw an error after telling the user they needed a TO argument. Fixes #3914.

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6789 41f8697f-d340-4b68-9986-7bafba869bb8
parent 5152770e
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -23,8 +23,13 @@ void IsisMain() {
  Process p;
  Cube *icube = p.SetInputCube("FROM");

  // Setup the histogram
  UserInterface &ui = Application::GetUserInterface();
  if(!ui.WasEntered("TO") && !ui.IsInteractive()) {
    QString msg = "The [TO] parameter must be entered";
    throw IException(IException::User, msg, _FILEINFO_);
  }
  
  // Setup the histogram
  Histogram hist(*icube, 1, p.Progress() );
  if(ui.WasEntered("MINIMUM") ) {
    hist.SetValidRange(ui.GetDouble("MINIMUM"),ui.GetDouble("MAXIMUM") );     
@@ -49,11 +54,6 @@ void IsisMain() {

  if(!ui.IsInteractive() || ui.WasEntered("TO") ) {
    // Write the results

    if(!ui.WasEntered("TO") ) {
      QString msg = "The [TO] parameter must be entered";
      throw IException(IException::User, msg, _FILEINFO_);
    }
    QString outfile = ui.GetFileName("TO");
    ofstream fout;
    fout.open(outfile.toAscii().data() );
+4 −0
Original line number Diff line number Diff line
@@ -76,6 +76,10 @@
      of user-specified bins displayed in grapical/text output.
      See Ref #2188.
    </change>
    <change name="Curtis Rose" date="2016-06-10">
     Changed the application to fail immediately if the TO argument is not
     entered from the commandline. Fixes #3914.
    </change>	
  </history>

  <oldName>