Commit 60613b22 authored by Kristin Berry's avatar Kristin Berry
Browse files

IGNOREALL in cnetedit now acts as documented. When (and only when) IGNOREALL...

IGNOREALL in cnetedit now acts as documented. When (and only when) IGNOREALL is true and a reference measure is removed, the entire point is removed. Fixes #2238

git-svn-id: http://subversion.wr.usgs.gov/repos/prog/isis3/trunk@6294 41f8697f-d340-4b68-9986-7bafba869bb8
parent 4024af4b
Loading
Loading
Loading
Loading
+11 −14
Original line number Diff line number Diff line
@@ -150,7 +150,7 @@ void IsisMain() {
    cubeSnl = new SerialNumberList(ignorelistFileName);
  }

  // List has Cube file names
  // List has measurelist file names
  bool processMeasures = false;
  QMap< QString, QSet<QString> * > *editMeasures = NULL;
  if (ui.WasEntered("MEASURELIST") && cnet.GetNumPoints() > 0) {
@@ -217,12 +217,12 @@ void IsisMain() {
      else {
        for (int cm = point->GetNumMeasures() - 1; cm >= 0; cm--) {
          if (point->GetMeasure(cm)->IsIgnored()) {
            if (cm == point->IndexOfRefMeasure()) {
              // If the reference is ignored, the point must ignored too
            if (cm == point->IndexOfRefMeasure() && ignoreAll) {
              // If the reference is ignored and IgnoreAll is set, the point must ignored too
              ignorePoint(cnet, point, "Reference measure ignored");
            }
            else {
              // Can't delete the reference without deleting the whole point
              // Can't delete the reference without deleting the whole point when ignoreAll is true
              deleteMeasure(point, cm);
            }
          }
@@ -503,8 +503,7 @@ void populateLog(ControlNet &cnet, bool ignore) {
      ControlMeasure *measure = point->GetMeasure(cm);

      if (measure->IsIgnored()) {
        if (cm == point->IndexOfRefMeasure()) {
          // If the reference is ignored, the point must be ignored too
        if (cm == point->IndexOfRefMeasure() && ignoreAll) {
          if (ignore && !point->IsIgnored()) {
            ignorePoint(cnet, point, "Reference measure ignored");
          }
@@ -561,7 +560,7 @@ void ignorePoints(ControlNet &cnet, ControlPointList &cpList) {

    if (deleteIgnored) {
      //look for previously ignored control points
      if (point->IsIgnored() || point->GetRefMeasure()->IsIgnored()) {
      if (point->IsIgnored()) {
        deletePoint(cnet, cp);
      }
      else {
@@ -661,15 +660,14 @@ void ignoreCubes(ControlNet &cnet, SerialNumberList &snl) {
        else if (!measure->IsIgnored() || cm == point->IndexOfRefMeasure()) {
          ignoreMeasure(cnet, point, measure, cause);

          if (cm == point->IndexOfRefMeasure() && !point->IsIgnored()) {
          if (cm == point->IndexOfRefMeasure() && !point->IsIgnored() && ignoreAll) {
            ignorePoint(cnet, point, "Reference measure ignored");
          }
        }
      }

      //also look for previously ignored control measures
      if (deleteIgnored && measure->IsIgnored() &&
          cm != point->IndexOfRefMeasure()) {
      if (deleteIgnored && measure->IsIgnored()) {
        deleteMeasure(point, cm);
      }
    }
@@ -768,7 +766,7 @@ void ignoreMeasures(ControlNet &cnet,
          else if (!measure->IsIgnored() || cm == point->IndexOfRefMeasure()) {
            ignoreMeasure(cnet, point, measure, cause);

            if (cm == point->IndexOfRefMeasure() && !point->IsIgnored()) {
            if (cm == point->IndexOfRefMeasure() && !point->IsIgnored() && ignoreAll) {
              ignorePoint(cnet, point, "Reference measure ignored");
            }
          }
@@ -885,7 +883,7 @@ void checkAllMeasureValidity(ControlNet &cnet, QString cubeList) {
          else {
            ignoreMeasure(cnet, point, measure, cause);

            if (measure == point->GetRefMeasure()) {
            if (measure == point->GetRefMeasure() && ignoreAll) {
              ignorePoint(cnet, point, "Reference measure ignored");
            }
          }
@@ -904,8 +902,7 @@ void checkAllMeasureValidity(ControlNet &cnet, QString cubeList) {
      ControlMeasure *measure = point->GetMeasure(cm);

      // Also look for previously ignored control measures
      if (deleteIgnored && measure->IsIgnored() &&
          measure != point->GetRefMeasure()) {
      if (deleteIgnored && measure->IsIgnored()) { //got rid of "never delete ref measures"
        deleteMeasure(point, cm);
      }
    }
+4 −0
Original line number Diff line number Diff line
@@ -132,6 +132,10 @@
    <change name="Steven Lambright" date="2012-05-03">
      Added "IGNOREALL" option. Fixes #293.
    </change>
    <change name="Kristin Berry" date="2015-07-30"> 
      Updated so that behavior is consistent with documentation. Now when a reference
      measure is removed, the whole point is only removed if IGNOREALL is true. 
    </change>
  </history>

  <category>
+13 −0
Original line number Diff line number Diff line
@@ -3,6 +3,7 @@ APPNAME = cnetedit
include $(ISISROOT)/make/isismake.tsts

commands:
# normal test
	$(LS) $(INPUT)/*.cub > $(OUTPUT)/list.lis;
	$(APPNAME) CNET=$(INPUT)/cnet.net \
	ONET=$(OUTPUT)/cnet.net \
@@ -11,4 +12,16 @@ commands:
       	FROMLIST=$(OUTPUT)/list.lis \
	DEFFILE=$(INPUT)/deffile.def \
	RETAIN_REFERENCE=yes > /dev/null;

# test with IGNOREALL=true
#	$(LS) $(INPUT)/*.cub > $(OUTPUT)/list.lis;
	$(APPNAME) CNET=$(INPUT)/cnet.net \
	ONET=$(OUTPUT)/cnet2.net \
	LOG=$(OUTPUT)/log2.txt \
	CHECKVALID=yes \
	IGNOREALL=true \
       	FROMLIST=$(OUTPUT)/list.lis \
	DEFFILE=$(INPUT)/deffile.def > /dev/null;

# Cleanup
	$(RM) $(OUTPUT)/list.lis;
+7 −0
Original line number Diff line number Diff line
@@ -3,6 +3,13 @@ APPNAME = cnetedit
include $(ISISROOT)/make/isismake.tsts

commands:
# original test
	$(APPNAME) CNET=$(INPUT)/cnet.net \
	POINTLIST=$(INPUT)/points.lis \
	ONET=$(OUTPUT)/cnet.net > /dev/null;

# test IGNOREALL=true with ignored input measures / points
	$(APPNAME) CNET=$(INPUT)/cnet.net \
	POINTLIST=$(INPUT)/points.lis \
	IGNOREALL = true \
	ONET=$(OUTPUT)/cnet2.net > /dev/null;
+15 −0
Original line number Diff line number Diff line
@@ -3,6 +3,8 @@ APPNAME = cnetedit
include $(ISISROOT)/make/isismake.tsts

commands:

# general test
	$(CAT) $(INPUT)/bad_measures.lis | $(SED) "s#,#,$(INPUT)/#" \
		> $(OUTPUT)/list.lis;

@@ -12,4 +14,17 @@ commands:
	DELETE=no \
	ONET=$(OUTPUT)/cnet.net > /dev/null;

# test with IGNOREALL = true, DELETE=yes measure that is a reference for a non-ignored point
	$(CAT) $(INPUT)/bad_measures2.lis | $(SED) "s#,#,$(INPUT)/#" \
		> $(OUTPUT)/list2.lis;

	$(APPNAME) CNET=$(INPUT)/cnet.net \
	LOG=$(OUTPUT)/log2.txt \
	MEASURELIST=$(OUTPUT)/list2.lis \
	IGNOREALL=true \
	DELETE=no \
	ONET=$(OUTPUT)/cnet2.net > /dev/null;

# Cleanup
	$(RM) $(OUTPUT)/list.lis;
	$(RM) $(OUTPUT)/list2.lis;