[GRASS-SVN] r62439 - in grass/branches/releasebranch_7_0: . imagery/i.eb.hsebal01

svn_grass at osgeo.org svn_grass at osgeo.org
Tue Oct 28 07:42:48 PDT 2014


Author: neteler
Date: 2014-10-28 07:42:48 -0700 (Tue, 28 Oct 2014)
New Revision: 62439

Modified:
   grass/branches/releasebranch_7_0/
   grass/branches/releasebranch_7_0/imagery/i.eb.hsebal01/main.c
Log:
i.eb.hsebal01: fixed logic for input wet/dry pixels coordinates, flag2 and flag3 (trunk, r62438)


Property changes on: grass/branches/releasebranch_7_0
___________________________________________________________________
Modified: svn:mergeinfo
   - /grass/trunk:61095,61098-61099,61788,61897,62141,62327,62346,62352,62354,62356,62360,62364,62415,62425
   + /grass/trunk:61095,61098-61099,61788,61897,62141,62327,62346,62352,62354,62356,62360,62364,62415,62425,62438

Modified: grass/branches/releasebranch_7_0/imagery/i.eb.hsebal01/main.c
===================================================================
--- grass/branches/releasebranch_7_0/imagery/i.eb.hsebal01/main.c	2014-10-28 14:29:32 UTC (rev 62438)
+++ grass/branches/releasebranch_7_0/imagery/i.eb.hsebal01/main.c	2014-10-28 14:42:48 UTC (rev 62439)
@@ -180,7 +180,12 @@
     ustar = atof(input_ustar->answer);
     ea = atof(input_ea->answer);
 
-    if(input_row_wet->answer&&
+    /*If automatic flag, just forget the rest of options*/ 
+    if(flag2->answer) 
+	    G_message(_("Automatic mode selected"));
+    /*If not automatic & all pixels locations in col/row given*/
+    else if (!flag2->answer && 
+    input_row_wet->answer&&
     input_col_wet->answer&&
     input_row_dry->answer&&
     input_col_dry->answer){
@@ -188,25 +193,17 @@
         m_col_wet = atof(input_col_wet->answer);
         m_row_dry = atof(input_row_dry->answer);
         m_col_dry = atof(input_col_dry->answer);
-    }
-    if ((!input_row_wet->answer || !input_col_wet->answer ||
-	 !input_row_dry->answer || !input_col_dry->answer) &&
-	!flag2->answer) {
-	G_fatal_error(_("Either auto-mode either wet/dry pixels coordinates should be provided!"));
-    }
-    if (flag3->answer) {
-	G_message(_("Manual wet/dry pixels in image coordinates"));
+        /*If pixels locations are in projected coordinates*/
+        if (flag3->answer)
+	    G_message(_("Manual wet/dry pixels in image coordinates"));
 	G_message(_("Wet Pixel=> x:%f y:%f"), m_col_wet, m_row_wet);
 	G_message(_("Dry Pixel=> x:%f y:%f"), m_col_dry, m_row_dry);
     }
+    /*If not automatic & missing any of the pixel location, Fatal Error*/
     else {
-        if(flag2->answer)
-	    G_message(_("Automatic mode selected"));
-	else {
-	    G_message(_("Wet Pixel=> row:%.0f col:%.0f"), m_row_wet, m_col_wet);
-	    G_message(_("Dry Pixel=> row:%.0f col:%.0f"), m_row_dry, m_col_dry);
-	}
+	G_fatal_error(_("Either auto-mode either wet/dry pixels coordinates should be provided!"));
     }
+
     /* check legal output name */
     if (G_legal_filename(h0) < 0)
 	G_fatal_error(_("<%s> is an illegal name"), h0);



More information about the grass-commit mailing list