[Stacomir-commits] r174 - in pkg/stacomir: . R data examples/01_BilanMigrationMult inst/config inst/test inst/test/testthat man

noreply at r-forge.r-project.org noreply at r-forge.r-project.org
Tue Aug 23 10:20:45 CEST 2016


Author: briand
Date: 2016-08-23 10:20:45 +0200 (Tue, 23 Aug 2016)
New Revision: 174

Added:
   pkg/stacomir/data/msg.rda
   pkg/stacomir/inst/config/calcmig.csv
   pkg/stacomir/inst/test/testthat/
   pkg/stacomir/inst/test/testthat/test-00stacomir.R
   pkg/stacomir/inst/test/testthat/test-01BilanMigrationMult.R
   pkg/stacomir/man/charge-RefPoidsMoyenPeche-method.Rd
Removed:
   pkg/stacomir/inst/test/test-00stacomirbaseconnection.R
   pkg/stacomir/inst/test/test-BilanMigrationMult.R
Modified:
   pkg/stacomir/DESCRIPTION
   pkg/stacomir/NAMESPACE
   pkg/stacomir/R/BilanConditionEnv.r
   pkg/stacomir/R/BilanEspeces.r
   pkg/stacomir/R/BilanFonctionnementDC.r
   pkg/stacomir/R/BilanFonctionnementDF.r
   pkg/stacomir/R/BilanMigration.r
   pkg/stacomir/R/BilanMigrationConditionEnv.r
   pkg/stacomir/R/BilanMigrationInterAnnuelle.r
   pkg/stacomir/R/BilanMigrationMult.r
   pkg/stacomir/R/BilanMigrationPar.r
   pkg/stacomir/R/Bilan_poids_moyen.r
   pkg/stacomir/R/Bilan_stades_pigm.r
   pkg/stacomir/R/Bilan_taille.r
   pkg/stacomir/R/PasDeTempsJournalier.r
   pkg/stacomir/R/PasdeTemps.r
   pkg/stacomir/R/RefDC.r
   pkg/stacomir/R/RefDF.r
   pkg/stacomir/R/RefHorodate.r
   pkg/stacomir/R/RefMsg.r
   pkg/stacomir/R/RefPoidsMoyenPeche.r
   pkg/stacomir/R/RefStades.r
   pkg/stacomir/R/RefTaxon.r
   pkg/stacomir/R/create_generic.r
   pkg/stacomir/R/fungraph.r
   pkg/stacomir/R/interface_Bilan_lot.r
   pkg/stacomir/R/messages.r
   pkg/stacomir/R/stacomi.r
   pkg/stacomir/R/utilitaires.r
   pkg/stacomir/examples/01_BilanMigrationMult/bilanMigrationMult_Arzal.R
   pkg/stacomir/inst/config/generate_Roxygen2.R
   pkg/stacomir/inst/config/generate_data.R
   pkg/stacomir/inst/config/libraries.r
   pkg/stacomir/inst/config/stacomi_manual_launch.r
   pkg/stacomir/inst/config/testthat.R
   pkg/stacomir/man/BilanConditionEnv-class.Rd
   pkg/stacomir/man/BilanEspeces-class.Rd
   pkg/stacomir/man/BilanFonctionnementDC-class.Rd
   pkg/stacomir/man/BilanFonctionnementDF-class.Rd
   pkg/stacomir/man/BilanMigration-class.Rd
   pkg/stacomir/man/BilanMigrationConditionEnv-class.Rd
   pkg/stacomir/man/BilanMigrationInterAnnuelle-class.Rd
   pkg/stacomir/man/BilanMigrationMult-class.Rd
   pkg/stacomir/man/BilanMigrationPar-class.Rd
   pkg/stacomir/man/Bilan_poids_moyen-class.Rd
   pkg/stacomir/man/Bilan_stades_pigm-class.Rd
   pkg/stacomir/man/Bilan_taille-class.Rd
   pkg/stacomir/man/RefPoidsMoyenPeche-class.Rd
   pkg/stacomir/man/ceil.POSIXt.Rd
   pkg/stacomir/man/choice-RefDC-method.Rd
   pkg/stacomir/man/choicemult-RefDC-method.Rd
   pkg/stacomir/man/createmessage-RefMsg-method.Rd
   pkg/stacomir/man/fungraph.Rd
   pkg/stacomir/man/husr.Rd
   pkg/stacomir/man/interface_graphique.Rd
   pkg/stacomir/man/stacomi.Rd
   pkg/stacomir/man/stacomiR-package.Rd
Log:
1. Developping unit test, 
2. Changing stacomi load function to be able to pass tests without connection to the database
3. Modificiations for Rckeck
4. Documentation

Modified: pkg/stacomir/DESCRIPTION
===================================================================
--- pkg/stacomir/DESCRIPTION	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/DESCRIPTION	2016-08-23 08:20:45 UTC (rev 174)
@@ -97,9 +97,11 @@
     utils,
     stats,
     lattice,
-    grDevices
+    grDevices,
+    Hmisc
 Author: Cedric Briand [aut, cre],
     Marion Legrand [aut]
 Maintainer: Cedric Briand <cedric.briand00 at gmail.com>
 RoxygenNote: 5.0.1
 NeedsCompilation: no
+Suggests: testthat

Modified: pkg/stacomir/NAMESPACE
===================================================================
--- pkg/stacomir/NAMESPACE	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/NAMESPACE	2016-08-23 08:20:45 UTC (rev 174)
@@ -1,5 +1,6 @@
 # Generated by roxygen2: do not edit by hand
 
+export(chargecsv)
 export(fun_bilanMigrationMult)
 export(fun_bilanMigrationMult_Overlaps)
 export(fun_weight_conversion)
@@ -23,6 +24,7 @@
 export(hbilanConditionEnvgraph)
 export(hbilanMigrationConditionEnvcalc)
 export(interface_BilanEspeces)
+export(messages)
 export(stacomi)
 exportClasses(BilanConditionEnv)
 exportClasses(BilanEspeces)
@@ -41,12 +43,12 @@
 exportMethods(charge_avec_filtre)
 exportMethods(choice_c)
 exportMethods(connect)
-exportMethods(createmessage)
 exportMethods(cumplot)
 exportMethods(plot1)
 exportMethods(print)
 exportMethods(setRefHorodate)
 exportMethods(summary)
+import(Hmisc)
 import(RColorBrewer)
 import(RODBC)
 import(RPostgreSQL)

Modified: pkg/stacomir/R/BilanConditionEnv.r
===================================================================
--- pkg/stacomir/R/BilanConditionEnv.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/BilanConditionEnv.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -16,7 +16,7 @@
 #' stationMesure=new("RefStationMesure"), data=data.frame(),
 #' requete=new("RequeteODBCwheredate"))}.
 #' @author cedric.briand"at"eptb-vilaine.fr
-#' @seealso Other Bilan Classes \code{\linkS4class{Bilan_lot}}
+#' @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}}

Modified: pkg/stacomir/R/BilanEspeces.r
===================================================================
--- pkg/stacomir/R/BilanEspeces.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/BilanEspeces.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -15,7 +15,7 @@
 #' @section Objects from the Class: Objects can be created by calls of the form
 #' \code{new("BilanEspeces", ...)}.
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Classes \code{\linkS4class{Bilan_lot}}
+#' @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}}

Modified: pkg/stacomir/R/BilanFonctionnementDC.r
===================================================================
--- pkg/stacomir/R/BilanFonctionnementDC.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/BilanFonctionnementDC.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -9,7 +9,7 @@
 #' @section Objects from the Class: Objects can be created by calls of the form
 #' \code{new("BilanFonctionnementDC", ...)}.
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Class \code{\linkS4class{Bilan_lot}}
+#' @seealso Other Bilan Class \code{\linkS4class{Bilan_carlot}}
 #' \code{\linkS4class{Bilan_poids_moyen}}
 #' \code{\linkS4class{Bilan_stades_pigm}} \code{\linkS4class{Bilan_taille}}
 #' \code{\linkS4class{BilanConditionEnv}} \code{\linkS4class{BilanEspeces}}

Modified: pkg/stacomir/R/BilanFonctionnementDF.r
===================================================================
--- pkg/stacomir/R/BilanFonctionnementDF.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/BilanFonctionnementDF.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -8,7 +8,7 @@
 #' @section Objects from the Class: Objects can be created by calls of the form
 #' \code{new("BilanFonctionnementDF")}.
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Class \code{\linkS4class{Bilan_lot}}
+#' @seealso Other Bilan Class \code{\linkS4class{Bilan_carlot}}
 #' \code{\linkS4class{Bilan_poids_moyen}}
 #' \code{\linkS4class{Bilan_stades_pigm}} 
 #' \code{\linkS4class{Bilan_taille}}

Modified: pkg/stacomir/R/BilanMigration.r
===================================================================
--- pkg/stacomir/R/BilanMigration.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/BilanMigration.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -37,7 +37,7 @@
 #' \item{:}{Object of class \code{"POSIXct"} : duration of the
 #' analysis} }
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Class \code{\linkS4class{Bilan_lot}}
+#' @seealso Other Bilan Class \code{\linkS4class{Bilan_carlot}}
 #' \code{\linkS4class{Bilan_poids_moyen}}
 #' \code{\linkS4class{Bilan_stades_pigm}} \code{\linkS4class{Bilan_taille}}
 #' \code{\linkS4class{BilanConditionEnv}} \code{\linkS4class{BilanEspeces}}

Modified: pkg/stacomir/R/BilanMigrationConditionEnv.r
===================================================================
--- pkg/stacomir/R/BilanMigrationConditionEnv.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/BilanMigrationConditionEnv.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -16,7 +16,7 @@
 #' \code{"BilanConditionEnv"} The environmental overview}\item{:}{Object of
 #' class \code{"BilanConditionEnv"} The environmental overview} }
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Class \code{\linkS4class{Bilan_lot}}
+#' @seealso Other Bilan Class \code{\linkS4class{Bilan_carlot}}
 #' \code{\linkS4class{Bilan_poids_moyen}}
 #' \code{\linkS4class{Bilan_stades_pigm}} \code{\linkS4class{Bilan_taille}}
 #' \code{\linkS4class{BilanConditionEnv}} \code{\linkS4class{BilanEspeces}}

Modified: pkg/stacomir/R/BilanMigrationInterAnnuelle.r
===================================================================
--- pkg/stacomir/R/BilanMigrationInterAnnuelle.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/BilanMigrationInterAnnuelle.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -16,7 +16,7 @@
 #' 	\code{"BilanConditionEnv"} The environmental overview}\item{:}{Object of
 #' 	class \code{"BilanConditionEnv"} The environmental overview} }
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Class \code{\linkS4class{Bilan_lot}}
+#' @seealso Other Bilan Class \code{\linkS4class{Bilan_carlot}}
 #' 	\code{\linkS4class{Bilan_poids_moyen}}
 #' 	\code{\linkS4class{Bilan_stades_pigm}} 
 #' 	\code{\linkS4class{Bilan_taille}}

Modified: pkg/stacomir/R/BilanMigrationMult.r
===================================================================
--- pkg/stacomir/R/BilanMigrationMult.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/BilanMigrationMult.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -160,7 +160,9 @@
 			bilanMigrationMult=connect(bilanMigrationMult)
 			cat(stringr::str_c("nrow=",nrow(bilanMigrationMult at data)))
 			
-			bilanMigrationMult at data$duree=difftime(bilanMigrationMult at data$ope_date_fin,bilanMigrationMult at data$ope_date_debut,unit="days")
+			bilanMigrationMult at data$duree=difftime(bilanMigrationMult at data$ope_date_fin,
+					bilanMigrationMult at data$ope_date_debut,
+					units="days")
 			debut=bilanMigrationMult at pasDeTemps@dateDebut
 			fin=DateFin(bilanMigrationMult at pasDeTemps)
 			time.sequence<-seq.POSIXt(from=debut,to=fin,

Modified: pkg/stacomir/R/BilanMigrationPar.r
===================================================================
--- pkg/stacomir/R/BilanMigrationPar.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/BilanMigrationPar.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -32,7 +32,7 @@
 #' @note program : default two parameter choice, checking box "aucun" will allow the program to ignore the parameter
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
 #' @seealso Other Bilan Class 
-#' \code{\linkS4class{Bilan_lot}}
+#' \code{\linkS4class{Bilan_carlot}}
 #' \code{\linkS4class{Bilan_poids_moyen}}
 #' \code{\linkS4class{Bilan_stades_pigm}} 
 #' \code{\linkS4class{Bilan_taille}}

Modified: pkg/stacomir/R/Bilan_poids_moyen.r
===================================================================
--- pkg/stacomir/R/Bilan_poids_moyen.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/Bilan_poids_moyen.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -35,7 +35,7 @@
 #' }\item{:}{Object of class \code{"RefListe"} RefListe referential class
 #' choose within a list, here do you want subsamples or not } }
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Classes \code{\linkS4class{Bilan_lot}}
+#' @seealso Other Bilan Classes \code{\linkS4class{Bilan_carlot}}
 #' \code{\linkS4class{Bilan_poids_moyen}}
 #' \code{\linkS4class{Bilan_stades_pigm}} 
 #' \code{\linkS4class{Bilan_taille}}

Modified: pkg/stacomir/R/Bilan_stades_pigm.r
===================================================================
--- pkg/stacomir/R/Bilan_stades_pigm.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/Bilan_stades_pigm.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -16,7 +16,7 @@
 #' @section Objects from the Class: Objects can be created by calls of the form
 #' \code{new("Bilan_stades_pigm", ...)}.
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Classes \code{\linkS4class{Bilan_lot}}
+#' @seealso Other Bilan Classes \code{\linkS4class{Bilan_carlot}}
 #' \code{\linkS4class{Bilan_poids_moyen}}
 #' \code{\linkS4class{Bilan_stades_pigm}} 
 #' \code{\linkS4class{Bilan_taille}}

Modified: pkg/stacomir/R/Bilan_taille.r
===================================================================
--- pkg/stacomir/R/Bilan_taille.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/Bilan_taille.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -17,7 +17,7 @@
 #' @section Objects from the Class: Objects can be created by calls of the form
 #' \code{new("Bilan_taille", ...)}
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @seealso Other Bilan Classes \code{\linkS4class{Bilan_lot}}
+#' @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}}

Modified: pkg/stacomir/R/PasDeTempsJournalier.r
===================================================================
--- pkg/stacomir/R/PasDeTempsJournalier.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/PasDeTempsJournalier.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -69,7 +69,7 @@
 					#dispose(winpa)
 				}
 				winpa=gframe(get("msg",envir=envir_stacomi)$PasdeTempsJournalier.3,container=group,horizontal=FALSE)
-				pg<-glayout(cont=winpa)
+				pg<-glayout(container=winpa)
 				pg[1,1]<-glabel(get("msg",envir=envir_stacomi)$PasdeTempsJournalier.4)
 				datedeb<-gedit(as.Date(getdateDebut(object)),handler=hwinpa,width=10)
 				pg[2,1]<-datedeb
@@ -143,7 +143,7 @@
 					}	
 				}
 					object at dateDebut<-as.POSIXlt(datedebut)
-					object at nbPas=as.numeric(difftime(datefin,datedebut,unit="days"))
+					object at nbPas=as.numeric(difftime(datefin,datedebut,units="days"))
 					validObject(object) 			
 					return(object)
 				})

Modified: pkg/stacomir/R/PasdeTemps.r
===================================================================
--- pkg/stacomir/R/PasdeTemps.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/PasdeTemps.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -274,11 +274,12 @@
 					# TODO a developper
 				}
 				winpa=gframe(get("msg",envir=envir_stacomi)$PasdeTemps.1,container=group,horizontal=FALSE)
-				pg<-ggroup(horizontal=FALSE,cont=winpa)
+				pg<-ggroup(horizontal=FALSE,container=winpa)
 				glabel("Date de debut",container=pg)
-				datedeb<-gedit(getdateDebut(object),cont=pg,handler=hchoicepas,width=15)
+				datedeb<-gedit(getdateDebut(object),
+						container=pg,handler=hchoicepas,width=15)
 				datedebut2=as.character(strftime(object at dateDebut,"%Y-%m-%d"))
-				datedeb2<-gcalendar(datedebut2,cont=pg,handler=function(h,...){
+				datedeb2<-gcalendar(datedebut2,container=pg,handler=function(h,...){
 							svalue(datedeb)<-as.character(strftime(
 											strptime(svalue(datedeb2),"%Y-%m-%d"),
 											"%Y-%m-%d %H:%M:%S"))
@@ -329,13 +330,13 @@
 						hchoicedatedebut=function(h,...){
 							# TODO a developper
 						}
-						groupdate<<-ggroup(cont=notebook, label="periode")   ## "add" called by constructor this is a tab of the notebook
+						groupdate<<-ggroup(container=notebook, label="periode")   ## "add" called by constructor this is a tab of the notebook
 						winpa=gframe(get("msg",envir=envir_stacomi)$PasdeTemps.1,container=groupdate,horizontal=FALSE)
-						pg<-ggroup(horizontal=FALSE,cont=winpa)
+						pg<-ggroup(horizontal=FALSE,container=winpa)
 						glabel("Date de debut",container=pg)
-						datedeb<-gedit(getdateDebut(object),cont=pg,handler=hchoicepas,width=15)
+						datedeb<-gedit(getdateDebut(object),container=pg,handler=hchoicepas,width=15)
 						datedebut2=as.character(strftime(object at dateDebut,"%Y-%m-%d"))
-						datedeb2<-gcalendar(datedebut2,cont=pg,handler=function(h,...){
+						datedeb2<-gcalendar(datedebut2,container=pg,handler=function(h,...){
 									svalue(datedeb)<-as.character(strftime(
 													strptime(svalue(datedeb2),"%Y-%m-%d"),
 													"%Y-%m-%d %H:%M:%S"))

Modified: pkg/stacomir/R/RefDC.r
===================================================================
--- pkg/stacomir/R/RefDC.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/RefDC.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -85,7 +85,7 @@
 #' choice method for RefDC
 #' 
 #' @note   The choice method has for arguments a report (bilan) object
-#'  (e.g) is called from a report Bilan(e.g Bilan_lot).
+#'  (e.g) is called from a report Bilan(e.g Bilan_carlot).
 #'   By default,  the value of the objectbilan is null.
 #'   When it is not   the method calls daughter widgets (e.g. the dc widget will call species) 
 #' and fills it with the method \link{charge_avec_filtre} 
@@ -128,11 +128,11 @@
 				# Handler d'affichage du tableau
 				hDCi=function(h,...){
 					w=gwindow(get("msg",envir=envir_stacomi)$RefDC.3,width=400)
-					wg=ggroup(horizontal=FALSE,cont=w)
+					wg=ggroup(horizontal=FALSE,container=w)
 					tab=gtable(object at data[,c(1,4,7,8,11,12)],chosencol=1,multiple=FALSE,expand=TRUE, container=wg)
-					bg<-ggroup(cont=wg)
+					bg<-ggroup(container=wg)
 					addSpring(bg)
-					gbutton(get("msg",envir=envir_stacomi)$RefDC.4, cont=bg, handler = function(h,...) dispose(w))
+					gbutton(get("msg",envir=envir_stacomi)$RefDC.4, container=bg, handler = function(h,...) dispose(w))
 				}
 				frame_DC<<-gframe(get("msg",envir=envir_stacomi)$RefDC.5)
 				add(group,frame_DC)
@@ -153,7 +153,7 @@
 #' choicemult, selection method for refDC allowing to select several DC
 #' 
 #' @note   The choice method has for arguments a report (bilan) object
-#'  (e.g) is called from a report Bilan(e.g Bilan_lot).
+#'  (e.g) is called from a report Bilan(e.g Bilan_carlot).
 #'   By default,  the value of the objectbilan is null.
 #'   When it is not   the method calls daughter widgets (e.g. the dc widget will call species) 
 #' and fills it with the method \link{charge_avec_filtre}
@@ -216,18 +216,18 @@
 				
 				DC=object at data[,c("dc","dis_commentaires","type_dc")]
 				#TODO addmsg
-				groupdc<<-ggroup(cont=notebook, label="dc")   ## "add" called by constructor this is a tab of the notebook
-				frameDCsource<-gframe(get("msg",envir=envir_stacomi)$RefDC.5,cont=groupdc)
+				groupdc<<-ggroup(container=notebook, label="dc")   ## "add" called by constructor this is a tab of the notebook
+				frameDCsource<-gframe(get("msg",envir=envir_stacomi)$RefDC.5,container=groupdc)
 				size(frameDCsource)<-c(250,300)
-				tbsourcedc  = gtable(DC,cont=frameDCsource,expand = TRUE, fill = TRUE)
+				tbsourcedc  = gtable(DC,container=frameDCsource,expand = TRUE, fill = TRUE)
 				
-				frameDCdest<-gframe("deposez ici",cont=groupdc)
+				frameDCdest<-gframe("deposez ici",container=groupdc)
 				size(frameDCdest)<-c(60,300)
 				#addSpring(groupdc)
 				# need for a fixed size data.frame otherwise errors when adding new lines
 				xx<-data.frame(choice=rep("",12))
 				xx$choice<-as.character(xx$choice)
-				tbdestdc=gtable(xx,cont=frameDCdest,expand=TRUE, fill=TRUE)
+				tbdestdc=gtable(xx,container=frameDCdest,expand=TRUE, fill=TRUE)
 				adddropsource(tbsourcedc)
 				adddroptarget(tbdestdc)				
 				adddropmotion(tbdestdc,handler=function(h,...) {

Modified: pkg/stacomir/R/RefDF.r
===================================================================
--- pkg/stacomir/R/RefDF.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/RefDF.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -89,11 +89,11 @@
 				# Handler d'affichage du tableau
 				hDFi=function(h,...){
 					w=gwindow(get("msg",envir=envir_stacomi)$RefDF.2,width=400)
-					wg=ggroup(horizontal=FALSE,cont=w)
+					wg=ggroup(horizontal=FALSE,container=w)
 					tab=gtable(object at data[,c(1,6,7)],chosencol=1,multiple=FALSE,expand=TRUE, container=wg)
-					bg<-ggroup(cont=wg)
+					bg<-ggroup(container=wg)
 					addSpring(bg)
-					gbutton(get("msg",envir=envir_stacomi)$RefDC.4, cont=bg, handler = function(h,...) dispose(w))
+					gbutton(get("msg",envir=envir_stacomi)$RefDC.4, container=bg, handler = function(h,...) dispose(w))
 				}
 				frameDF=gframe(get("msg",envir=envir_stacomi)$RefDF.3,container=group)
 				DF_identifiant=object at data$df

Modified: pkg/stacomir/R/RefHorodate.r
===================================================================
--- pkg/stacomir/R/RefHorodate.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/RefHorodate.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -86,11 +86,11 @@
 				object<-getanneeprec(object,decal)
 			}
 			winhor=gframe(label,container=group,horizontal=!affichecal)
-			pg<-ggroup(horizontal=FALSE,cont=winhor)
-			horodate<-gedit(getRefHorodate(object),cont=pg,handler=hwinhor,width=20)
+			pg<-ggroup(horizontal=FALSE,container=winhor)
+			horodate<-gedit(getRefHorodate(object),container=pg,handler=hwinhor,width=20)
 			horodate2=as.character(strftime(object at horodate,"%Y-%m-%d"))
 			if (affichecal) {
-#				horocal<-gcalendar(horodate2,cont=pg,handler=function(h,...){
+#				horocal<-gcalendar(horodate2,container=pg,handler=function(h,...){
 #							svalue(horodate)<-as.character(strftime(
 #											strptime(svalue(horocal),"%Y-%m-%d"),
 #											"%Y-%m-%d %H:%M:%S"))

Modified: pkg/stacomir/R/RefMsg.r
===================================================================
--- pkg/stacomir/R/RefMsg.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/RefMsg.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -1,10 +1,3 @@
-# Nom fichier :        RefMsg   (classe)
-# Projet :             controle migrateur
-# Organisme :          IAV
-# Auteur :             Cedric Briand
-# Contact :            cedric.briand"at"eptb-vilaine.fr
-# Date de creation :   31/03/2008 17:21:30
-
 #' RefMsg referential class to load message according to the language chosen
 #' 
 #' @slot data A data.frame
@@ -44,7 +37,6 @@
 #'  object=new("RefMsg")
 #'  charge_avec_filtre(object,lang='French')
 #' }
-#' @export
 setMethod("charge_avec_filtre",signature=signature("RefMsg"),definition=function(object,lang) {
 			requete=new("RequeteODBCwhere")
 			requete at baseODBC<-get("baseODBC",envir=envir_stacomi)
@@ -59,66 +51,72 @@
 
 #' createmessage method for RefMsg referential objects 
 #' 
+#' @param pre_launch_test Default to TRUE, if FALSE, no database connection is expected and the messages will be loaded from msg dataset within the package
 #' @return An S4 object of class RefMsg
-#' @note When coming from the database, " are now /", those at the beginning and end are turned into ", the others are single quote when they are to be pasted within the text as code example. The remainder "c("a","b","c") are rebuilt into vectors by the function
+#' @note When coming from the database, doublequotes are now escaped with an antislash (/"), those at the beginning and end are left as doublequotes, 
+#' the others are single quote when they are to be pasted within the text as code example. The remainder "c("a","b","c") are rebuilt into vectors by the function
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @export
-setMethod("createmessage",signature=signature("RefMsg"),definition=function(object) {
-			#object=new("RefMsg")
-			object<-charge(object)
-			object<-charge_avec_filtre(object,lang=get("lang",envir=envir_stacomi))
-			if (nrow(object at messager)!=nrow(object at messagerlang)) stop("internal error, check messager and messagerlang length, they should match")
-			msg=list()
-			buildmsg<-merge(object at messager,object at messagerlang,by.x="msr_id",by.y="mrl_msr_id")
-			buildmsg$msr_endofline2<-ifelse(as.logical(buildmsg$"msr_endofline"),"\n","")
-			buildmsg1<-apply(buildmsg,1,function(X)stringr::str_c(X["msr_element"],
-								".",
-								as.integer(X["msr_number"])))
-			# special case for graphical interface which contains number like 2.1 ...
-			buildmsg1[buildmsg$msr_element=="interface_graphique_menu"]<-apply(buildmsg[buildmsg$msr_element=="interface_graphique_menu",],1,function(X)stringr::str_c(X["msr_element"],
-								".",
-								as.character(X["msr_number"])))
-			buildmsg1<-gsub(' ', '', buildmsg1)
-			buildmsg2<-apply(buildmsg,1,function(X)stringr::str_c(
-								X["mrl_text"],
-								X["msr_endofline2"]))
-			nettoye<-function(X){
-				X<-gsub(".00","",X)		
-				X<-gsub("0","",X)
-				return(X)
-			}
-			buildmsg1[buildmsg$msr_element=="interface_graphique_menu"]<-nettoye(buildmsg1[buildmsg$msr_element=="interface_graphique_menu"])
-		
-			
-			
-			# l' interface_graphique_menu.2.1 est l� deux fois, il faut le remettre le 2.10 � la main
-			buildmsg1[match("interface_graphique_menu.2.9",buildmsg1)+1]<-"interface_graphique_menu.2.10"
-			# here I'm dealing with "\" but only at the beginning and ending of strings
-			list<-gregexpr("(\")", buildmsg2)
-			for (i in 1:length(buildmsg2)){
-				if (length(list[[i]])<=2) buildmsg2[i]<-gsub("\"","", buildmsg2[i])						
-			}
-			# dealing with the special problems of vectors which I want as vector c("toto","titi") and not as "c(toto,titi)" 
-			# 
-			create_vector<-function(m){
-				# expressions contenant get
-				index<-grep("(c\\()",m)
-				# debug j<-index[1]
-				for (j in index){
-					list<-gregexpr("(\")", m[[j]])
-					# getting vector elements and coalescing them in a vector
-					m[[j]]<-do.call(c,lapply(2*(1:(length(list[[1]])/2))-1,function(i){
-										substring(m[[j]],list[[1]][i]+1,list[[1]][i+1]-1)
-									}))
+setMethod("createmessage",signature=signature("RefMsg"),definition=function(object,pre_launch_test) {
+			if (pre_launch_test){
+				#object=new("RefMsg")
+				object<-charge(object)
+				object<-charge_avec_filtre(object,lang=get("lang",envir=envir_stacomi))
+				if (nrow(object at messager)!=nrow(object at messagerlang)) stop("internal error, check messager and messagerlang length, they should match")
+				msg=list()
+				buildmsg<-merge(object at messager,object at messagerlang,by.x="msr_id",by.y="mrl_msr_id")
+				buildmsg$msr_endofline2<-ifelse(as.logical(buildmsg$"msr_endofline"),"\n","")
+				buildmsg1<-apply(buildmsg,1,function(X)stringr::str_c(X["msr_element"],
+									".",
+									as.integer(X["msr_number"])))
+				# special case for graphical interface which contains number like 2.1 ...
+				buildmsg1[buildmsg$msr_element=="interface_graphique_menu"]<-apply(buildmsg[buildmsg$msr_element=="interface_graphique_menu",],1,function(X)stringr::str_c(X["msr_element"],
+									".",
+									as.character(X["msr_number"])))
+				buildmsg1<-gsub(' ', '', buildmsg1)
+				buildmsg2<-apply(buildmsg,1,function(X)stringr::str_c(
+									X["mrl_text"],
+									X["msr_endofline2"]))
+				nettoye<-function(X){
+					X<-gsub(".00","",X)		
+					X<-gsub("0","",X)
+					return(X)
 				}
-				return(m)
+				buildmsg1[buildmsg$msr_element=="interface_graphique_menu"]<-nettoye(buildmsg1[buildmsg$msr_element=="interface_graphique_menu"])
 				
+				
+				
+				# internal problem patch
+				buildmsg1[match("interface_graphique_menu.2.9",buildmsg1)+1]<-"interface_graphique_menu.2.10"
+				# here I'm dealing with "\" but only at the beginning and ending of strings
+				list<-gregexpr("(\")", buildmsg2)
+				for (i in 1:length(buildmsg2)){
+					if (length(list[[i]])<=2) buildmsg2[i]<-gsub("\"","", buildmsg2[i])						
+				}
+				# dealing with the special problems of vectors which I want as vector c("toto","titi") and not as "c(toto,titi)" 
+				# 
+				create_vector<-function(m){
+					# expressions contenant get
+					index<-grep("(c\\()",m)
+					# debug j<-index[1]
+					for (j in index){
+						list<-gregexpr("(\")", m[[j]])
+						# getting vector elements and coalescing them in a vector
+						m[[j]]<-do.call(c,lapply(2*(1:(length(list[[1]])/2))-1,function(i){
+											substring(m[[j]],list[[1]][i]+1,list[[1]][i+1]-1)
+										}))
+					}
+					return(m)
+					
+				}
+				
+				for (i in 1:length(buildmsg1)){
+					msg[buildmsg1[i]]<-buildmsg2[i]
+				}
+				msg<-create_vector(msg)
+				assign("msg",msg,envir=envir_stacomi)
+			} else	{ # !pre_launch_test
+				data("msg")
+				assign("msg",msg,envir=envir_stacomi)
 			}
-		
-			for (i in 1:length(buildmsg1)){
-				msg[buildmsg1[i]]<-buildmsg2[i]
-			}
-			msg<-create_vector(msg)
-			assign("msg",msg,envir=envir_stacomi)
 			invisible(NULL)
 		})

Modified: pkg/stacomir/R/RefPoidsMoyenPeche.r
===================================================================
--- pkg/stacomir/R/RefPoidsMoyenPeche.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/RefPoidsMoyenPeche.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -13,13 +13,20 @@
 #' \item{list("datefin")}{Object of class \code{"POSIXlt"} ~ Ending
 #' year}\item{:}{Object of class \code{"POSIXlt"} ~ Ending year} }
 #' @author cedric.briand"at"eptb-vilaine.fr
-#' @seealso Other referential classes \code{\linkS4class{RefAnnee}}
-#' \code{\linkS4class{RefCheckBox}} \code{\linkS4class{RefChoix}}
-#' \code{\linkS4class{RefCoe}} \code{\linkS4class{RefDC}}
-#' \code{\linkS4class{RefDF}} \code{\linkS4class{RefListe}}
-#' \code{\linkS4class{Refpar}} \code{\linkS4class{Refparqual}}
-#' \code{\linkS4class{Refparquan}} \code{\linkS4class{RefPoidsMoyenPeche}}
-#' \code{\linkS4class{RefStades}} \code{\linkS4class{RefStationMesure}}
+#' @seealso Other referential classes 
+#' \code{\linkS4class{RefAnnee}}
+#' \code{\linkS4class{RefCheckBox}} 
+#' \code{\linkS4class{RefChoix}}
+#' \code{\linkS4class{RefCoe}} 
+#' \code{\linkS4class{RefDC}}
+#' \code{\linkS4class{RefDF}} 
+#' \code{\linkS4class{RefListe}}
+#' \code{\linkS4class{Refpar}} 
+#' \code{\linkS4class{Refparqual}}
+#' \code{\linkS4class{Refparquan}} 
+#' \code{\linkS4class{RefPoidsMoyenPeche}}
+#' \code{\linkS4class{RefStades}} 
+#' \code{\linkS4class{RefStationMesure}}
 #' \code{\linkS4class{RefTaxon}}
 #' @keywords classes
 #' @family Referential objects
@@ -29,8 +36,17 @@
 # pour test  
 # object= new("RefPoidsMoyenPeche")
 
-#retourne la liste des annees presentes dans la base
+
+
+#' Charge method for RefPoidsMoyenPeche
+#' 
+#' @return An object of class \code{\linkS4class{RefPoidsMoyenPeche}}
+#' 
+#' @author cedric.briand
+#' @docType methods
+#' @export
 setMethod("charge",signature=signature("RefPoidsMoyenPeche"),definition=function(object){
+			baseODBCmortciv<-get("baseODBCmortciv",envir=envir_stacomi)
 			requete=new("RequeteODBCwheredate")
 			requete at datedebut=object at datedebut
 			requete at datefin=object at datefin
@@ -53,5 +69,3 @@
 			object at data<-requete at query
 			return(object)
 		})
-# pas de methode choice, le choice est deja fait dans l'annee de l'interface
-#charge(refPoidsMoyenPeche)
\ No newline at end of file

Modified: pkg/stacomir/R/RefStades.r
===================================================================
--- pkg/stacomir/R/RefStades.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/RefStades.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -206,15 +206,15 @@
 				std_libelle=fun_char_spe(object at data$std_libelle)
 				groupstd<<-ggroup() 
 				add(notebook,groupstd,label="stade")
-				framestdsource<-gframe(get("msg",envir=envir_stacomi)$RefStades.6,cont=groupstd)
-				tbsourcestd  = gtable(std_libelle,cont=framestdsource,expand = TRUE, fill = TRUE)
+				framestdsource<-gframe(get("msg",envir=envir_stacomi)$RefStades.6,container=groupstd)
+				tbsourcestd  = gtable(std_libelle,container=framestdsource,expand = TRUE, fill = TRUE)
 				size(tbsourcestd)<-c(160,300) 
 				#TODO addmsg
-				framestddest<-gframe("deposez ici",cont=groupstd)
+				framestddest<-gframe("deposez ici",container=groupstd)
 				# need for a fixed size data.frame otherwise errors when adding new lines
 				xx<-data.frame(choice=rep("",8))
 				xx$choice<-as.character(xx$choice)
-				tbdeststd=gtable(xx,cont=framestddest,expand = TRUE, fill = TRUE)
+				tbdeststd=gtable(xx,container=framestddest,expand = TRUE, fill = TRUE)
 				size(tbdeststd)<-c(160,300)
 				adddropsource(tbsourcestd)
 				adddroptarget(tbdeststd)				

Modified: pkg/stacomir/R/RefTaxon.r
===================================================================
--- pkg/stacomir/R/RefTaxon.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/RefTaxon.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -145,16 +145,16 @@
 				tax_libelle=fun_char_spe(object at data$tax_nom_latin)
 				grouptaxon<<-ggroup() 
 				add(notebook,grouptaxon,label="taxon")
-				frametaxonsource<-gframe(get("msg",envir=envir_stacomi)$RefTaxon.2,cont=grouptaxon)
-				tbsourcetaxon  = gtable(tax_libelle,cont=frametaxonsource,expand = TRUE, fill = TRUE)
+				frametaxonsource<-gframe(get("msg",envir=envir_stacomi)$RefTaxon.2,container=grouptaxon)
+				tbsourcetaxon  = gtable(tax_libelle,container=frametaxonsource,expand = TRUE, fill = TRUE)
 				size(tbsourcetaxon)<-c(160,300) # les dimensions sont testees a la main 
 				# pour s'ajuster aux dimensions du notebook (largeur 400)
 				#TODO addmsg
-				frametaxondest<-gframe("deposez ici",cont=grouptaxon)
+				frametaxondest<-gframe("deposez ici",container=grouptaxon)
 				# need for a fixed size data.frame otherwise errors when adding new lines
 				xx<-data.frame(choice=rep("",8))
 				xx$choice<-as.character(xx$choice)
-				tbdesttaxon=gtable(xx,cont=frametaxondest,expand = TRUE, fill = TRUE)
+				tbdesttaxon=gtable(xx,container=frametaxondest,expand = TRUE, fill = TRUE)
 				size(tbdesttaxon)<-c(160,300)
 				adddropsource(tbsourcetaxon)
 				adddroptarget(tbdesttaxon)				

Modified: pkg/stacomir/R/create_generic.r
===================================================================
--- pkg/stacomir/R/create_generic.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/create_generic.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -34,4 +34,4 @@
 #' 
 #' 
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-envir_stacomi <- new.env(parent = emptyenv())
+"envir_stacomi"

Modified: pkg/stacomir/R/fungraph.r
===================================================================
--- pkg/stacomir/R/fungraph.r	2016-08-20 20:12:58 UTC (rev 173)
+++ pkg/stacomir/R/fungraph.r	2016-08-23 08:20:45 UTC (rev 174)
@@ -1,54 +1,32 @@
-# Nom fichier :        funraph.R
-# Projet :             calcmig/fonctions
-
-# Description :       graph pour bilan migration autres que civelles
-
-
 #' Function for BilanMigration graphes including numbers DF DC operations
 #' 
 #' This graph is for species other than glass eel
 #' 
 #' 
-#' @usage fungraph(bilanMigration, tableau, duree, taxon, stade)
+#' @usage fungraph(bilanMigration, tableau, time.sequence, taxon, stade,...)
 #' @param bilanMigration an object of class \code{\linkS4class{BilanMigration}}
 #' @param table=tableau a data frame with the results
-#' @param duree a vector POSIXt
+#' @param time.sequence a vector POSIXt
 #' @param taxon the species
 #' @param stade the stage
+#' @param ... other parameters passed but not used
 #' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-
-
-
-
-
-
-
-#' Function for BilanMigration graphes including numbers DF DC operations
-#' 
-#' @param bilanMigration an object of class \code{\linkS4class{BilanMigration}} or an
-#' object of class \code{\linkS4class{BilanMigrationMult}}
-#' @param tableau a data frame with the results
-#' @param duree a vector POSIXt
-#' @param taxon the species
-#' @param stade the stage
-#' @param dc the dc, default to null, only necessary for  \code{\linkS4class{BilanMigrationMult}}
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-fungraph=function(bilanMigration,tableau,duree,taxon,stade,dc=null){
+fungraph=function(bilanMigration,tableau,time.sequence,taxon,stade,dc=null,...){
 #mat <- matrix(1:6,3,2)
 #layout(mat)
 	# pour adapter aux bilanMigrationMult, ligne par d�faut...
 	if (is.null(dc)) dc=bilanMigration at dc@dc_selectionne[1]
 	if(length(unique(tableau$type_de_quantite[!is.na(tableau$type_de_quantite)]))>1) funout(get("msg",envir=envir_stacomi)$fungraph.1) 
[TRUNCATED]

To get the complete diff run:
    svnlook diff /svnroot/stacomir -r 174


More information about the Stacomir-commits mailing list