[Stacomir-commits] r571 - in pkg/stacomir/R: . po
noreply at r-forge.r-project.org
noreply at r-forge.r-project.org
Mon Oct 11 10:08:59 CEST 2021
Author: briand
Date: 2021-10-11 10:08:59 +0200 (Mon, 11 Oct 2021)
New Revision: 571
Removed:
pkg/stacomir/R/ref_checkbox.R
Modified:
pkg/stacomir/R/po/R-stacomiR_fr_FR.mo
pkg/stacomir/R/po/R-stacomiR_fr_FR.po
pkg/stacomir/R/ref_choice.R
pkg/stacomir/R/ref_coe.R
pkg/stacomir/R/ref_dc.R
pkg/stacomir/R/ref_df.R
pkg/stacomir/R/ref_env.R
pkg/stacomir/R/ref_horodate.R
pkg/stacomir/R/ref_list.R
pkg/stacomir/R/ref_par.R
pkg/stacomir/R/ref_parqual.R
pkg/stacomir/R/ref_period.R
pkg/stacomir/R/ref_stage.R
pkg/stacomir/R/ref_taxa.R
pkg/stacomir/R/ref_textbox.R
pkg/stacomir/R/ref_timestep.R
pkg/stacomir/R/ref_timestep_daily.R
pkg/stacomir/R/ref_year.R
pkg/stacomir/R/report_annual.R
pkg/stacomir/R/report_mig_char.R
pkg/stacomir/R/utilities.R
Log:
259: Transfert version 0.6
Task-Url: http://w3.eptb-vilaine.fr:8080/tracstacomi/ticket/259
: Rapport didson 2019 2020
Modified: pkg/stacomir/R/po/R-stacomiR_fr_FR.mo
===================================================================
(Binary files differ)
Modified: pkg/stacomir/R/po/R-stacomiR_fr_FR.po
===================================================================
--- pkg/stacomir/R/po/R-stacomiR_fr_FR.po 2021-08-04 15:26:02 UTC (rev 570)
+++ pkg/stacomir/R/po/R-stacomiR_fr_FR.po 2021-10-11 08:08:59 UTC (rev 571)
@@ -2,7 +2,7 @@
msgstr ""
"Project-Id-Version: stacomiR 0.5.0\n"
"POT-Creation-Date: 2017-07-31 13:54\n"
-"PO-Revision-Date: 2017-07-31 14:12+0200\n"
+"PO-Revision-Date: 2021-08-04 14:32+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
"Language: fr_FR\n"
@@ -9,7 +9,7 @@
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
-"X-Generator: Poedit 2.0.3\n"
+"X-Generator: Poedit 3.0\n"
"Plural-Forms: nplurals=2; plural=(n > 1);\n"
msgid "Writing monthly summary in the database"
@@ -1707,7 +1707,7 @@
"base version 0.5, vérifiez le lien ODBC"
msgid "ODBC link"
-msgstr "lien ODBC"
+msgstr "Lien ODBC"
msgid "User"
msgstr "Utilisateur"
@@ -1788,13 +1788,14 @@
msgstr "Sorties du programme"
msgid "The vector passed to vector_to_listsql should not be null"
-msgstr ""
+msgstr "Le vecteur passé à vector_to_listsql ne doit pas être nul"
msgid "The vector passed to vector_to_listsql should not be NA"
-msgstr ""
+msgstr "Le vecteur passé à vector_to_listsql ne doit pas être NA"
msgid "The vector passed to vector_to_listsql should not be of lenght zero"
msgstr ""
+"Le vecteur passé à vector_to_listsql ne doit pas être de longueur nulle"
msgid "horodatedebut not in column names for data"
msgstr ""
@@ -1804,7 +1805,7 @@
msgstr "horodatefin n'apparaît pas dans les noms de colonnes dans les données"
msgid "The color argument should have length %s"
-msgstr "l'argument couleur doit avoir une longueur %s"
+msgstr "L’argument color doit avoir une longueur %s"
msgid "The following name(s) %s do not match vector name: %s"
msgstr "Les noms suivants %s ne correspondent pas à ceux du vecteur %s"
Deleted: pkg/stacomir/R/ref_checkbox.R
===================================================================
--- pkg/stacomir/R/ref_checkbox.R 2021-08-04 15:26:02 UTC (rev 570)
+++ pkg/stacomir/R/ref_checkbox.R 2021-10-11 08:08:59 UTC (rev 571)
@@ -1,66 +0,0 @@
-#' ref_checkbox referencial class
-#'
-#' referential class allows to choose for several parms with checkbox
-#' @slot title A "character", the title of the box giving the possible choices
-#' @slot labels The logical parameters choice
-#' @slot checked A boolean vector
-#' @section Objects from the Class: Objects can be created by calls of the form
-#' \code{new("ref_checkbox", ...)}.
-#' @family referential objects
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-setClass(Class="ref_checkbox",representation= representation(title="character",labels="character",checked="logical"),
- prototype=prototype(title="liste de choice",labels="choice",checked=FALSE))
-
-#' Loading method for ref_checkbox referential objects
-#' @param object An object of class \link{ref_checkbox-class}
-#' @param title Title of the frame
-#' @param labels Labels for checked
-#' @param checked Vector of boolean indicating if ref_checkbox are checked
-#' @return An object of class \link{ref_checkbox-class}
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @examples
-#' \dontrun{
-#' object=new("ref_checkbox")
-#' charge(object,title="essai",labels=c("par1","par2","par3"),checked=c(TRUE,TRUE,TRUE))
-#' }
-setMethod("charge",signature=signature("ref_checkbox"),definition=function(object,title,labels,checked) {
- if (length(labels) != length(checked)) stop ("les longeur de 'labels' et 'checked' sont differentes")
- object at title=title
- object at labels=labels
- object at checked=checked
- return(object)
- })
-#' Choice method for ref_checkbox referential objects
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @param object An object of class \link{ref_checkbox-class}
-#' @examples
-#' \dontrun{
-#' object=new("ref_checkbox")
-#' object<- charge(object,title="essai",labels=c("par1","par2","par3"),checked=c(TRUE,TRUE,TRUE))
-#' win=gwindow(title="test ref_checkbox")
-#' group=ggroup(container=win,horizontal=FALSE)
-#' choice(object)
-#' dispose(win)
-#' }
-#' @keywords internal
-setMethod("choice",signature=signature("ref_checkbox"),definition=function(object) {
- hlist=function(h,...){
- i=h$action
- if (exists("ref_checkbox",envir_stacomi)) {
- object<-get("ref_checkbox",envir_stacomi)
- }
- object at checked[i]<-svalue(the_choice[[i]])
- assign("ref_checkbox",object,envir_stacomi)
- funout(paste("choice",object at labels[i],"\n"))
- }
- group<-get("group",envir=envir_stacomi)
- frame_check<-gframe(object at title)
- assign("frame_check",frame_check,envir=envir_stacomi)
- ##=>selection de plusieurs caracteristiques
- add(group,frame_check)
- the_choice=list()
- for(i in 1: length(object at labels)){
- the_choice[[i]]=gcheckbox(text=object at labels[i], action=i,checked = object at checked[i],container=frame_check,handler=hlist)
- }
- })
-
Modified: pkg/stacomir/R/ref_choice.R
===================================================================
--- pkg/stacomir/R/ref_choice.R 2021-08-04 15:26:02 UTC (rev 570)
+++ pkg/stacomir/R/ref_choice.R 2021-10-11 08:08:59 UTC (rev 571)
@@ -1,7 +1,7 @@
#' Class "ref_choice"
#'
#' ref_choice referential class allows to choose within several values with
-#' radiobuttons
+#' radiobuttons interface
#'
#' @section Objects from the Class: Objects can be created by calls of the form
#' \code{new("ref_choice", listechoice=character() ,label=character()
@@ -18,7 +18,7 @@
prototype=list(
selectedvalue=vector()))
-#' Loading method for Rechoice referential objects
+#' Loading method for Refchoice referential objects
#'
#' @family referential objects
#' @return An S4 object of class ref_choice
@@ -39,36 +39,37 @@
object
return(object)
})
-#' Choice method for Rechoice referential objects
-#'
-#' Used by the graphical interface.
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @param object An object of class \link{ref_choice-class}
-#' @examples
-#' \dontrun{
-#' object=new("ref_choice")
-#' object<-charge(object,vecteur=c("oui","non"),label="essai",selected=as.integer(1))
-#' win=gwindow(title="test ref_choice")
-#' group=ggroup(container=win,horizontal=FALSE)
-#' choice(object)
-#' dispose(win)}
-#' @keywords internal
-setMethod("choice",signature=signature("ref_choice"),definition=function(object) {
- hlist=function(h,...){
- valeurchoisie=svalue(choice)
- object at listechoice<-valeurchoisie
- assign("refchoice",object,envir_stacomi)
- funout(paste(object at label,"\n"))
- }
- group<-get("group",envir=envir_stacomi)
- frame_choice<-gframe(object at label)
- assign("frame_choice",frame_choice,envir=envir_stacomi)
- ##=>selection de plusieurs caracteristiques
- add(group,frame_choice)
- list_libelle=fun_char_spe(object at listechoice)
- choice=gradio(items=list_libelle,selected=object at selected,horizontal=TRUE,container=frame_choice,handler=hlist)
- gbutton("OK", container=frame_choice,handler=hlist)
- })
+#deprecated0.6
+##' Choice method for Rechoice referential objects
+##'
+##' Used by the graphical interface.
+##' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
+##' @param object An object of class \link{ref_choice-class}
+##' @examples
+##' \dontrun{
+##' object=new("ref_choice")
+##' object<-charge(object,vecteur=c("oui","non"),label="essai",selected=as.integer(1))
+##' win=gwindow(title="test ref_choice")
+##' group=ggroup(container=win,horizontal=FALSE)
+##' choice(object)
+##' dispose(win)}
+##' @keywords internal
+#setMethod("choice",signature=signature("ref_choice"),definition=function(object) {
+# hlist=function(h,...){
+# valeurchoisie=svalue(choice)
+# object at listechoice<-valeurchoisie
+# assign("refchoice",object,envir_stacomi)
+# funout(paste(object at label,"\n"))
+# }
+# group<-get("group",envir=envir_stacomi)
+# frame_choice<-gframe(object at label)
+# assign("frame_choice",frame_choice,envir=envir_stacomi)
+# ##=>selection de plusieurs caracteristiques
+# add(group,frame_choice)
+# list_libelle=fun_char_spe(object at listechoice)
+# choice=gradio(items=list_libelle,selected=object at selected,horizontal=TRUE,container=frame_choice,handler=hlist)
+# gbutton("OK", container=frame_choice,handler=hlist)
+# })
#' Choice_c method for refchoix referential objects
#' @param object An object of class \link{ref_list-class}
@@ -96,39 +97,39 @@
})
-
-#' Multiple Choice method for ref_choice referential objects, to put together with notebook widgets
-#' @param object An object of class \link{ref_choice-class}
-#' @param selected_value the value selected in the combo
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @keywords internal
-setMethod("choicemult",signature=signature("ref_choice"),definition=function(object,
- selected_value
- ) {
- hlist=function(h,...){
- valeurchoisie=svalue(choice)
- object at selectedvalue<-valeurchoisie
- assign("refchoice",object,envir_stacomi)
- funout(gettext("choice made\n",domain="R-stacomiR"))
- if (svalue(notebook)<length(notebook)){
- svalue(notebook)<-svalue(notebook)+1
- }
- }
- group<-get("group",envir=envir_stacomi)
- if (!exists("notebook",envir=envir_stacomi)){
- notebook <- gnotebook(container=group)
- } else {
- notebook<-get("notebook",envir=envir_stacomi)
- }
- groupchoice<-ggroup(container=notebook,
- label=gettext("options",domain="R-stacomiR"),
- horizontal=FALSE)
- glabel(object at label,container=groupchoice)
- list_libelle=fun_char_spe(object at listechoice)
- choice=gradio(items=list_libelle,
- selected=object at selected,
- horizontal=FALSE,
- container=groupchoice,
- handler=hlist)
- gbutton("OK", container=groupchoice,handler=hlist)
- })
\ No newline at end of file
+#deprecated0.6
+##' Multiple Choice method for ref_choice referential objects, to put together with notebook widgets
+##' @param object An object of class \link{ref_choice-class}
+##' @param selected_value the value selected in the combo
+##' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
+##' @keywords internal
+#setMethod("choicemult",signature=signature("ref_choice"),definition=function(object,
+# selected_value
+# ) {
+# hlist=function(h,...){
+# valeurchoisie=svalue(choice)
+# object at selectedvalue<-valeurchoisie
+# assign("refchoice",object,envir_stacomi)
+# funout(gettext("choice made\n",domain="R-stacomiR"))
+# if (svalue(notebook)<length(notebook)){
+# svalue(notebook)<-svalue(notebook)+1
+# }
+# }
+# group<-get("group",envir=envir_stacomi)
+# if (!exists("notebook",envir=envir_stacomi)){
+# notebook <- gnotebook(container=group)
+# } else {
+# notebook<-get("notebook",envir=envir_stacomi)
+# }
+# groupchoice<-ggroup(container=notebook,
+# label=gettext("options",domain="R-stacomiR"),
+# horizontal=FALSE)
+# glabel(object at label,container=groupchoice)
+# list_libelle=fun_char_spe(object at listechoice)
+# choice=gradio(items=list_libelle,
+# selected=object at selected,
+# horizontal=FALSE,
+# container=groupchoice,
+# handler=hlist)
+# gbutton("OK", container=groupchoice,handler=hlist)
+# })
\ No newline at end of file
Modified: pkg/stacomir/R/ref_coe.R
===================================================================
--- pkg/stacomir/R/ref_coe.R 2021-08-04 15:26:02 UTC (rev 570)
+++ pkg/stacomir/R/ref_coe.R 2021-10-11 08:08:59 UTC (rev 571)
@@ -1,4 +1,4 @@
-# Nom fichier : ref_coe(classe)
+# Name : ref_coe(classe)
#' Class "ref_coe"
#'
Modified: pkg/stacomir/R/ref_dc.R
===================================================================
--- pkg/stacomir/R/ref_dc.R 2021-08-04 15:26:02 UTC (rev 570)
+++ pkg/stacomir/R/ref_dc.R 2021-10-11 08:08:59 UTC (rev 571)
@@ -78,224 +78,224 @@
})
+#deprecated0.6
+##' Graphical method to choose a fishway through the interface
+##'
+##' @note The choice method has for arguments a report (report) object
+##' (e.g) is called from a report report(e.g report_sample_char).
+##' By default, the value of the objectreport 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_with_filter,ref_taxa-method}
+##' @param object An object of class \link{ref_dc-class}
+##' @param objectreport the objectreport from which this frame was called
+##' @param is.enabled a boolean indicating whether the current frame will be enabled. Selecting a "parent"
+##' frame may cause some frame to be disabled. When created the frame is enabled.
+##' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
+##' @examples \dontrun{
+##' win=gwindow()
+##' group=ggroup(container=win,horizontal=FALSE)
+##' object=new("ref_dc")
+##' object<-charge(object)
+##' objectreport=new("report_mig")
+##' choice(object=object,objectreport=objectreport)
+##'}
+##' @keywords internal
+#setMethod("choice",signature=signature("ref_dc"),definition=function(object,objectreport=NULL,is.enabled=TRUE) {
+# if (nrow(object at data) > 0){
+# h_report_dc=function(h,...){
+# object at dc_selectionne<-svalue(choice)
+# object at ouvrage= object at data$dif_ouv_identifiant[object at data$dc%in%object at dc_selectionne]
+# object at station=object at data$sta_code[object at data$dc%in%object at dc_selectionne]
+# assign("ref_dc",object,envir_stacomi)
+# funout(gettext("Counting device selected\n",domain="R-stacomiR"))
+# # si il existe un object fils; supprimer
+# # referentiel fils, celui charge par la methode charge_with_filter
+# # ici comme on fait appel e un autre object il faut appeller le conteneur qui contient l'object
+# if (!is.null(objectreport)) {
+# # ci dessous pas d'appel de charge_with_filter pour les report_species (tous les taxa)
+# # pas non plus d'appel pour les report_silver_eel dont les slots taxa, stage ,et par sont fixes
+# if("ref_taxa"%in%as.character(getSlots(class(objectreport)))&class(objectreport)!="report_silver_eel"&class(objectreport)!="report_sea_age"){
+# objectreport at taxa<<-charge_with_filter(object=objectreport at taxa,dc_selectionne=get("ref_dc",object,envir_stacomi)@dc_selectionne)
+# if (exists("frame_tax",envir=envir_stacomi)) {
+# frame_tax<-get("frame_tax",envir=envir_stacomi)
+# delete(group,frame_tax)
+# }
+# if (exists("frame_std",envir=envir_stacomi)) {
+# frame_std<-get("frame_std",envir=envir_stacomi)
+# delete(group,frame_std)
+# }
+# if (exists("frame_par",envir=envir_stacomi)) {
+# frame_par<-get("frame_par",envir=envir_stacomi)
+# delete(group,frame_par)
+# }
+# if (exists("frame_parquan",envir=envir_stacomi)) {
+# frame_parquan<-get("frame_parquan",envir=envir_stacomi)
+# delete(group,frame_parquan)
+# }
+# if (exists("frame_parqual",envir=envir_stacomi)) {
+# frame_parqual<-get("frame_parqual",envir=envir_stacomi)
+# delete(group,frame_parqual)
+# }
+# choice(objectreport at taxa,objectreport,is.enabled=TRUE)
+# funout(gettext("Select taxa for this counting device (for all periods)\n",domain="R-stacomiR"))
+# }
+# }
+# #dispose(winst)
+# }
+# # Handler d'affichage du tableau
+# h_report_dci=function(h,...){
+# w=gwindow(gettext("Counting devices data",domain="R-stacomiR",width=400))
+# 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(container=wg)
+# addSpring(bg)
+# gbutton(gettext("close",domain="R-stacomiR"), container=bg, handler = function(h,...) dispose(w))
+# }
+# group<-get("group",envir=envir_stacomi)
+# frame_DC<-gframe(gettext("Counting devices choice",domain="R-stacomiR"))
+# assign("frame_DC",frame_DC,envir_stacomi)
+# add(group,frame_DC)
+# DC_identifiant=object at data$dc
+# choice=gdroplist(DC_identifiant,container=frame_DC,handler=h_report_dc)
+# gbutton(gettext("Table",domain="R-stacomiR"), container=frame_DC,handler=h_report_dci)
+# enabled(frame_DC)<-is.enabled
+# gbutton("OK", container=frame_DC,handler=h_report_dc)
+# } else {
+# funout(gettext("Error : no counting device in the database (the query returns 0 entry)\n",domain="R-stacomiR"),arret=TRUE)
+# }
+# return(object)
+# })
+## pour test #choice(object)
-#' Graphical method to choose a fishway through the interface
-#'
-#' @note The choice method has for arguments a report (report) object
-#' (e.g) is called from a report report(e.g report_sample_char).
-#' By default, the value of the objectreport 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_with_filter,ref_taxa-method}
-#' @param object An object of class \link{ref_dc-class}
-#' @param objectreport the objectreport from which this frame was called
-#' @param is.enabled a boolean indicating whether the current frame will be enabled. Selecting a "parent"
-#' frame may cause some frame to be disabled. When created the frame is enabled.
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @examples \dontrun{
-#' win=gwindow()
-#' group=ggroup(container=win,horizontal=FALSE)
-#' object=new("ref_dc")
-#' object<-charge(object)
-#' objectreport=new("report_mig")
-#' choice(object=object,objectreport=objectreport)
-#'}
-#' @keywords internal
-setMethod("choice",signature=signature("ref_dc"),definition=function(object,objectreport=NULL,is.enabled=TRUE) {
- if (nrow(object at data) > 0){
- h_report_dc=function(h,...){
- object at dc_selectionne<-svalue(choice)
- object at ouvrage= object at data$dif_ouv_identifiant[object at data$dc%in%object at dc_selectionne]
- object at station=object at data$sta_code[object at data$dc%in%object at dc_selectionne]
- assign("ref_dc",object,envir_stacomi)
- funout(gettext("Counting device selected\n",domain="R-stacomiR"))
- # si il existe un object fils; supprimer
- # referentiel fils, celui charge par la methode charge_with_filter
- # ici comme on fait appel e un autre object il faut appeller le conteneur qui contient l'object
- if (!is.null(objectreport)) {
- # ci dessous pas d'appel de charge_with_filter pour les report_species (tous les taxa)
- # pas non plus d'appel pour les report_silver_eel dont les slots taxa, stage ,et par sont fixes
- if("ref_taxa"%in%as.character(getSlots(class(objectreport)))&class(objectreport)!="report_silver_eel"&class(objectreport)!="report_sea_age"){
- objectreport at taxa<<-charge_with_filter(object=objectreport at taxa,dc_selectionne=get("ref_dc",object,envir_stacomi)@dc_selectionne)
- if (exists("frame_tax",envir=envir_stacomi)) {
- frame_tax<-get("frame_tax",envir=envir_stacomi)
- delete(group,frame_tax)
- }
- if (exists("frame_std",envir=envir_stacomi)) {
- frame_std<-get("frame_std",envir=envir_stacomi)
- delete(group,frame_std)
- }
- if (exists("frame_par",envir=envir_stacomi)) {
- frame_par<-get("frame_par",envir=envir_stacomi)
- delete(group,frame_par)
- }
- if (exists("frame_parquan",envir=envir_stacomi)) {
- frame_parquan<-get("frame_parquan",envir=envir_stacomi)
- delete(group,frame_parquan)
- }
- if (exists("frame_parqual",envir=envir_stacomi)) {
- frame_parqual<-get("frame_parqual",envir=envir_stacomi)
- delete(group,frame_parqual)
- }
- choice(objectreport at taxa,objectreport,is.enabled=TRUE)
- funout(gettext("Select taxa for this counting device (for all periods)\n",domain="R-stacomiR"))
- }
- }
- #dispose(winst)
- }
- # Handler d'affichage du tableau
- h_report_dci=function(h,...){
- w=gwindow(gettext("Counting devices data",domain="R-stacomiR",width=400))
- 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(container=wg)
- addSpring(bg)
- gbutton(gettext("close",domain="R-stacomiR"), container=bg, handler = function(h,...) dispose(w))
- }
- group<-get("group",envir=envir_stacomi)
- frame_DC<-gframe(gettext("Counting devices choice",domain="R-stacomiR"))
- assign("frame_DC",frame_DC,envir_stacomi)
- add(group,frame_DC)
- DC_identifiant=object at data$dc
- choice=gdroplist(DC_identifiant,container=frame_DC,handler=h_report_dc)
- gbutton(gettext("Table",domain="R-stacomiR"), container=frame_DC,handler=h_report_dci)
- enabled(frame_DC)<-is.enabled
- gbutton("OK", container=frame_DC,handler=h_report_dc)
- } else {
- funout(gettext("Error : no counting device in the database (the query returns 0 entry)\n",domain="R-stacomiR"),arret=TRUE)
- }
- return(object)
- })
-# pour test #choice(object)
+# deprecated 0.6
+##' choicemult, selection method for ref_dc allowing to select several DC
+##'
+##' @note The choice method has for arguments a report (report) object
+##' (e.g) is called from a report report(e.g report_sample_char).
+##' By default, the value of the objectreport 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_with_filter,ref_taxa-method}
+##' @param object An object of class ref_dc
+##' @param objectreport A report object
+##' @param is.enabled A boolean indicating if the widget can be seleted at launch
+##' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
+##' @examples
+##' \dontrun{
+##' win=gwindow()
+##' group=ggroup(container=win,horizontal=FALSE)
+##' object=new("ref_dc")
+##' object<-charge(object)
+##' objectreport=new("report_mig_mult")
+##' choicemult(object=object,objectreport=objectreport)
+##'}
+#setMethod("choicemult",signature=signature("ref_dc"),definition=function(object,objectreport=NULL,is.enabled=TRUE) {
+#
+# if (nrow(object at data) > 0){
+# h_report_dc=function(h,...){
+# #browser()
+# dc_selectionne<-tbdestdc[,][tbdestdc[,]!=""]
+# object at dc_selectionne<-as.integer(dc_selectionne)
+# if (length(dc_selectionne)>0){
+# object at ouvrage= object at data$dif_ouv_identifiant[object at data$dc%in%object at dc_selectionne]
+# object at station= as.character(object at data$sta_code[object at data$dc%in%object at dc_selectionne])
+# assign("ref_dc",object,envir_stacomi)
+# funout(gettext("Counting device selected\n",domain="R-stacomiR"))
+# # si il existe un object fils; supprimer
+# # referentiel fils, celui charge par la methode charge_with_filter
+# # ici comme on fait appel e un autre object il faut appeller le conteneur qui contient l'object
+# if (!is.null(objectreport)) {
+# # ci dessous pas d'appel de charge_with_filter pour les report_species (tous les taxa)
+# if("ref_taxa"%in%as.character(getSlots(class(objectreport)))){
+#
+#
+# objectreport at dc<-object
+# objectreport at taxa<-charge_with_filter(object=objectreport at taxa,dc_selectionne=get("ref_dc",envir_stacomi)@dc_selectionne)
+# # the name was created by the interface
+# # as I can't get the name from within the function (deparse(substitute(objectreport does not return
+# # "report_mig_mult"
+# assign(get("objectreport",envir=envir_stacomi),objectreport,envir=envir_stacomi)
+# # suppresses all tab larger than (dc)
+#
+# currenttab<-svalue(notebook)
+# if (length(notebook)>currenttab){
+# for (i in length(notebook):(currenttab+1)){
+# svalue(notebook) <- i
+# dispose(notebook) ## dispose current tab
+# }}
+# choicemult(objectreport at taxa,objectreport,is.enabled=TRUE)
+# #funout(gettext("Select taxa for this counting device (for all periods)\n",domain="R-stacomiR"))
+# }
+# }
+# # changing tab of notebook to next tab
+# if (svalue(notebook)<length(notebook)){
+# svalue(notebook)<-svalue(notebook)+1
+# }
+# #dispose(winst)
+# } else {
+# funout(gettext("Counting device not selected\n",domain="R-stacomiR"))
+#
+# }
+# }
+# # Handler d'affichage du tableau
+# # below the widget structure [=> within (=> type
+# # group(ggroup)[nb(notebook)[groupdc(ggroup&tab)[[frameDCsource(gframe)[tbsourcedc(gtable)],frameDCdest(gframe)[tbdcdest(gtable)]],OKbutton]]
+# notebook<-get("notebook",envir=envir_stacomi)
+# DC=object at data[,c("dc","dis_commentaires","type_dc")]
+# groupdc<-ggroup(container=notebook, label="dc") ## "add" called by constructor this is a tab of the notebook
+# assign("groupdc",groupdc,envir=envir_stacomi)
+# frameDCsource<-gframe(gettext("Counting devices choice",domain="R-stacomiR"),container=groupdc)
+# size(frameDCsource)<-c(250,300)
+# tbsourcedc = gtable(DC,container=frameDCsource,expand = TRUE, fill = TRUE)
+#
+# frameDCdest<-gframe(gettext("drop here",domain="R-stacomiR"),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,container=frameDCdest,expand=TRUE, fill=TRUE)
+# adddropsource(tbsourcedc)
+# adddroptarget(tbdestdc)
+# adddropmotion(tbdestdc,handler=function(h,...) {
+# valeurs<-tbdestdc[,]
+# valeurs<-valeurs[valeurs!=""]
+# if (!svalue(tbsourcedc)%in%valeurs){
+# tbdestdc[length(valeurs)+1,1]<-svalue(tbsourcedc)
+# }
+# })
+# addHandlerDoubleclick(tbsourcedc,handler=function(h,...) {
+# valeurs<-tbdestdc[,]
+# valeurs<-valeurs[valeurs!=""]
+# if (!svalue(tbsourcedc)%in%valeurs){
+# tbdestdc[length(valeurs)+1,1]<-svalue(h$obj)
+# }
+# })
+# adddropsource(tbdestdc)
+# adddroptarget(tbsourcedc)
+# removedc<-function(){
+# valeurs<-tbdestdc[,]
+# valeurs<-valeurs[valeurs!=""]
+# valeurs<-valeurs[-match(svalue(tbdestdc),valeurs)]
+# tbdestdc[,]<-c(valeurs,rep("",8-length(valeurs)))
+# }
+# adddropmotion(tbsourcedc,handler=function(h,...) {
+# removedc()
+# })
+# addHandlerDoubleclick(tbdestdc,handler=function(h,...) {
+# removedc()
+# })
+# gbutton("OK", container = groupdc, handler = h_report_dc)
+# } else {
+# funout(gettext("Error : no counting device in the database (the query returns 0 entry)\n",domain="R-stacomiR"),arret=TRUE)
+# }
+# #return(object)
+# })
-#' choicemult, selection method for ref_dc allowing to select several DC
-#'
-#' @note The choice method has for arguments a report (report) object
-#' (e.g) is called from a report report(e.g report_sample_char).
-#' By default, the value of the objectreport 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_with_filter,ref_taxa-method}
-#' @param object An object of class ref_dc
-#' @param objectreport A report object
-#' @param is.enabled A boolean indicating if the widget can be seleted at launch
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @examples
-#' \dontrun{
-#' win=gwindow()
-#' group=ggroup(container=win,horizontal=FALSE)
-#' object=new("ref_dc")
-#' object<-charge(object)
-#' objectreport=new("report_mig_mult")
-#' choicemult(object=object,objectreport=objectreport)
-#'}
-setMethod("choicemult",signature=signature("ref_dc"),definition=function(object,objectreport=NULL,is.enabled=TRUE) {
-
- if (nrow(object at data) > 0){
- h_report_dc=function(h,...){
- #browser()
- dc_selectionne<-tbdestdc[,][tbdestdc[,]!=""]
- object at dc_selectionne<-as.integer(dc_selectionne)
- if (length(dc_selectionne)>0){
- object at ouvrage= object at data$dif_ouv_identifiant[object at data$dc%in%object at dc_selectionne]
- object at station= as.character(object at data$sta_code[object at data$dc%in%object at dc_selectionne])
- assign("ref_dc",object,envir_stacomi)
- funout(gettext("Counting device selected\n",domain="R-stacomiR"))
- # si il existe un object fils; supprimer
- # referentiel fils, celui charge par la methode charge_with_filter
- # ici comme on fait appel e un autre object il faut appeller le conteneur qui contient l'object
- if (!is.null(objectreport)) {
- # ci dessous pas d'appel de charge_with_filter pour les report_species (tous les taxa)
- if("ref_taxa"%in%as.character(getSlots(class(objectreport)))){
-
-
- objectreport at dc<-object
- objectreport at taxa<-charge_with_filter(object=objectreport at taxa,dc_selectionne=get("ref_dc",envir_stacomi)@dc_selectionne)
- # the name was created by the interface
- # as I can't get the name from within the function (deparse(substitute(objectreport does not return
- # "report_mig_mult"
- assign(get("objectreport",envir=envir_stacomi),objectreport,envir=envir_stacomi)
- # suppresses all tab larger than (dc)
-
- currenttab<-svalue(notebook)
- if (length(notebook)>currenttab){
- for (i in length(notebook):(currenttab+1)){
- svalue(notebook) <- i
- dispose(notebook) ## dispose current tab
- }}
- choicemult(objectreport at taxa,objectreport,is.enabled=TRUE)
- #funout(gettext("Select taxa for this counting device (for all periods)\n",domain="R-stacomiR"))
- }
- }
- # changing tab of notebook to next tab
- if (svalue(notebook)<length(notebook)){
- svalue(notebook)<-svalue(notebook)+1
- }
- #dispose(winst)
- } else {
- funout(gettext("Counting device not selected\n",domain="R-stacomiR"))
-
- }
- }
- # Handler d'affichage du tableau
- # below the widget structure [=> within (=> type
- # group(ggroup)[nb(notebook)[groupdc(ggroup&tab)[[frameDCsource(gframe)[tbsourcedc(gtable)],frameDCdest(gframe)[tbdcdest(gtable)]],OKbutton]]
- notebook<-get("notebook",envir=envir_stacomi)
- DC=object at data[,c("dc","dis_commentaires","type_dc")]
- groupdc<-ggroup(container=notebook, label="dc") ## "add" called by constructor this is a tab of the notebook
- assign("groupdc",groupdc,envir=envir_stacomi)
- frameDCsource<-gframe(gettext("Counting devices choice",domain="R-stacomiR"),container=groupdc)
- size(frameDCsource)<-c(250,300)
- tbsourcedc = gtable(DC,container=frameDCsource,expand = TRUE, fill = TRUE)
-
- frameDCdest<-gframe(gettext("drop here",domain="R-stacomiR"),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,container=frameDCdest,expand=TRUE, fill=TRUE)
- adddropsource(tbsourcedc)
- adddroptarget(tbdestdc)
- adddropmotion(tbdestdc,handler=function(h,...) {
- valeurs<-tbdestdc[,]
- valeurs<-valeurs[valeurs!=""]
- if (!svalue(tbsourcedc)%in%valeurs){
- tbdestdc[length(valeurs)+1,1]<-svalue(tbsourcedc)
- }
- })
- addHandlerDoubleclick(tbsourcedc,handler=function(h,...) {
- valeurs<-tbdestdc[,]
- valeurs<-valeurs[valeurs!=""]
- if (!svalue(tbsourcedc)%in%valeurs){
- tbdestdc[length(valeurs)+1,1]<-svalue(h$obj)
- }
- })
- adddropsource(tbdestdc)
- adddroptarget(tbsourcedc)
- removedc<-function(){
- valeurs<-tbdestdc[,]
- valeurs<-valeurs[valeurs!=""]
- valeurs<-valeurs[-match(svalue(tbdestdc),valeurs)]
- tbdestdc[,]<-c(valeurs,rep("",8-length(valeurs)))
- }
- adddropmotion(tbsourcedc,handler=function(h,...) {
- removedc()
- })
- addHandlerDoubleclick(tbdestdc,handler=function(h,...) {
- removedc()
- })
- gbutton("OK", container = groupdc, handler = h_report_dc)
- } else {
- funout(gettext("Error : no counting device in the database (the query returns 0 entry)\n",domain="R-stacomiR"),arret=TRUE)
- }
- #return(object)
- })
-
-
#' Command line interface to select a counting device
#'
-#' the choice_c method is intendedto have the same behaviour as choice (which creates a
+#' the choice_c method is intended to have the same behaviour as choice (which creates a
#' widget in the graphical interface) but from the command line. The parameters for dc are transformed to integer as the ref_dc only
#' takes integer in the dc slots. The method also loads the stations and ouvrages (dams) associated with the counting device (dc).
#' The values passed to the choice_c method are then checked with the setValidty method.
Modified: pkg/stacomir/R/ref_df.R
===================================================================
--- pkg/stacomir/R/ref_df.R 2021-08-04 15:26:02 UTC (rev 570)
+++ pkg/stacomir/R/ref_df.R 2021-10-11 08:08:59 UTC (rev 571)
@@ -1,5 +1,3 @@
-# Nom fichier : ref_df (classe)
-
#' Class "ref_df"
#'
#' Representation of a fishway, contains description data of all fishways from
@@ -67,48 +65,49 @@
return(object)
})
-#' Graphical method to choose a fishway through the interface
-#' @param object An object of class \link{ref_df-class}
-#' @note the choice method assigns an object of class ref_df in the environment envir_stacomi
-#' @author Cedric Briand \email{cedric.briand"at"eptb-vilaine.fr}
-#' @examples
-#' \dontrun{
-#' win=gwindow()
-#' group=ggroup(container=win,horizontal=FALSE)
-#' object=new("ref_df")
-#' object<-charge(object)
-#' choice(object)
-#' }
-#' @keywords internal
-setMethod("choice",signature=signature("ref_df"),definition=function(object) {
[TRUNCATED]
To get the complete diff run:
svnlook diff /svnroot/stacomir -r 571
More information about the Stacomir-commits
mailing list