[Stacomir-commits] r315 - pkg/stacomir/R

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Sat Mar 18 21:34:16 CET 2017


Author: briand
Date: 2017-03-18 21:34:15 +0100 (Sat, 18 Mar 2017)
New Revision: 315

Modified:
   pkg/stacomir/R/BilanConditionEnv.r
Log:
developping choice_c method for BilanConditionEnv

Modified: pkg/stacomir/R/BilanConditionEnv.r
===================================================================
--- pkg/stacomir/R/BilanConditionEnv.r	2017-03-18 20:13:13 UTC (rev 314)
+++ pkg/stacomir/R/BilanConditionEnv.r	2017-03-18 20:34:15 UTC (rev 315)
@@ -18,18 +18,10 @@
 #' stationMesure=new("RefStationMesure"), data=data.frame(),
 #' requete=new("RequeteODBCwheredate"))}.
 #' @author cedric.briand"at"eptb-vilaine.fr
-#' @seealso Other Bilan Classes \code{\linkS4class{Bilan_carlot}}
-#' \code{\linkS4class{Bilan_poids_moyen}}
-#' \code{\linkS4class{Bilan_stades_pigm}} \code{\linkS4class{Bilan_taille}}
-#' \code{\linkS4class{BilanConditionEnv}} \code{\linkS4class{BilanEspeces}}
-#' \code{\linkS4class{BilanFonctionnementDC}}
-#' \code{\linkS4class{BilanFonctionnementDF}}
-#' \code{\linkS4class{BilanMigration}}
-#' \code{\linkS4class{BilanMigrationConditionEnv}}
-#' \code{\linkS4class{BilanMigrationInterAnnuelle}}
-#' \code{\linkS4class{BilanMigrationPar}}
-#' @concept Bilan Object 
+#' @family Bilan Objects
 #' @keywords classes
+#' @aliases BilanConditionEnv bilanConditionEnv
+#' @keywords classes
 #' @export 
 setClass(Class="BilanConditionEnv",
 		representation=representation(
@@ -78,7 +70,36 @@
 			return(object)
 		}
 )
-
+#' command line interface for BilanConditionEnv class
+#' @param object An object of class \link{BilanConditionEnv-class}
+#' @param stationmesure A character, the code of the monitoring station, which records environmental parameters \link{choice_c,RefStationMesure-method}
+#' @param datedebut The starting date as a character, formats like \code{\%Y-\%m-\%d} or \code{\%d-\%m-\%Y} can be used as input
+#' @param datefin The finishing date of the Bilan, for this class this will be used to calculate the number of daily steps.
+#' @param silent Boolean default FALSE, if TRUE information messages not displayed.
+#' @return An object of class \link{BilanConditionEnv-class}
+#' The choice_c method fills in the data slot for RefStationMesure and  and then 
+#' uses the choice_c methods of these object to select the data.
+#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
+#' @export
+setMethod("choice_c",signature=signature("BilanConditionEnv"),definition=function(object,stationMesure,datedebut,datefin,silent=FALSE){
+			# code for debug using bM_Arzal example
+			#stationmesure=c("temp_gabion","coef_maree");datedebut="2008-01-01";datefin="2008-12-31";silent=FALSE
+			bil_CE<-object
+			bil_CE at stationMesure=charge(bil_CE at stationMesure)
+			# loads and verifies the stationmesure (selects the relevant lines in the table
+			bil_CE at stationMesure<-choice_c(object=bil_CE at stationMesure,stationMesure)
+			bil_CE at horodate<-choice_c(object=bil_CE at horodate,
+					nomassign="bilanConditionEnv_date_debut",
+					funoutlabel=gettext("Beginning date has been chosen\n",domain="R-stacomiR"),
+					horodate=datedebut, 
+					silent=silent)
+			bil_CE at horodate<-choice_c(bil_CE at horodate,
+					nomassign="bilanConditionEnv_date_fin",
+					funoutlabel=gettext("Ending date has been chosen\n",domain="R-stacomiR"),
+					horodate=datefin,
+					silent=silent)
+			return(bil_CE)
+		})
 #' charge method for BilanCondtionEnv class
 #' @param object An object of class \link{BilanConditionEnv-class}
 #' @param h A handler



More information about the Stacomir-commits mailing list