Commit 639416d0 authored by Tyler Wilson's avatar Tyler Wilson
Browse files

Hist app now displays correct number of user entered bins when min/max values...

Hist app now displays correct number of user entered bins when min/max values also entered.Ref(#2188)

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6379 41f8697f-d340-4b68-9986-7bafba869bb8
parent eaf1f0b6
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
#include "Isis.h"

#include <QString>
#include <QMenuBar>

#include "Process.h"
#include "CubePlotCurve.h"
#include "Histogram.h"
#include "UserInterface.h"
#include "Progress.h"
#include "HistogramItem.h"
#include "HistogramPlotWindow.h"
#include "LineManager.h"
#include "Process.h"
#include "Progress.h"
#include "QHistogram.h"
#include "HistogramPlotWindow.h"
#include "HistogramItem.h"
#include "CubePlotCurve.h"
#include "UserInterface.h"


#include <QString>
#include <QMenuBar>


using namespace std;
using namespace Isis;
@@ -26,6 +29,7 @@ void IsisMain() {
  if(ui.WasEntered("MINIMUM") ) {
    hist.SetValidRange(ui.GetDouble("MINIMUM"),ui.GetDouble("MAXIMUM") );     
  }

  if(ui.WasEntered("NBINS")) {
    hist.SetBins(ui.GetInteger("NBINS"));
  }
@@ -35,6 +39,7 @@ void IsisMain() {
  p.Progress()->SetMaximumSteps(icube->lineCount());
  p.Progress()->CheckStatus();
  LineManager line(*icube);

  for(int i = 1; i <= icube->lineCount(); i++) {
    line.SetLine(i);
    icube->read(line);
@@ -204,5 +209,6 @@ void IsisMain() {

    plot->showWindow();
  }

  p.EndProcess();
}
+5 −0
Original line number Diff line number Diff line
@@ -71,6 +71,11 @@
    <change name="Noah Hilt" date="2008-08-01">
      Changed the plot window to the new HistogramToolWindow
    </change>
   <change name="Tyler Wilson" date="2015-09-01">
      Changed SetValidRange call to SetBinRange so correct number
      of user-specified bins displayed in grapical/text output.
      See Ref #2188.
   </change>	
  </history>

  <oldName>
+1 −1
Original line number Diff line number Diff line
@@ -36,7 +36,7 @@ void IsisMain() {

  // Set "match" to have the same data range and number of bins as "to"
  match->SetBins(fromBins);
  match->SetValidRange(fromMin, fromMax);
  //match->SetValidRange(fromMin, fromMax);
  for(int i = 0; i < fromBins; i++) {
    data[i] = fromMin + (slope * i);
  }
+6 −0
Original line number Diff line number Diff line
@@ -41,6 +41,12 @@
    <change name="Steven Lambright" date="2008-05-13">
      Removed references to CubeInfo 
    </change>
   <change name="Tyler Wilson" date="2015-09-03">
     Commented out a call to Histogram::SetValidRange(min,max)
     Because of changes made to the Histogram class.
     See Ref. #2188.
   </change>

  </history>

  <groups>
+3 −2
Original line number Diff line number Diff line
@@ -1243,7 +1243,7 @@ namespace Isis {
    LineManager line(*this);

    // This range is for throwing out data; the default parameters are OK always
    hist->SetValidRange(validMin, validMax);
    //hist->SetValidRange(validMin, validMax);

    // We now need to know the binning range - ValidMinimum/Maximum are no longer
    //   acceptable, default to the bin range start/end.
@@ -1257,7 +1257,8 @@ namespace Isis {
      binMax = hist->BinRangeEnd();
    }

    hist->SetBinRange(binMin, binMax);
    //hist->SetBinRange(binMin, binMax);
    hist->SetValidRange(binMin,binMax);

    // Loop and get the histogram
    progress.SetText(msg);
Loading