[chronojump] server automatically graph new data at night (if there's new data) Print info label to user about th



commit d17fa855ad83c8f7a2957aafb62bbe088447bbc8
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Jan 15 17:22:53 2010 +0100

    server automatically graph new data at night
    (if there's new data)
    Print info label to user about this.
    Added server R graphs to git

 chronojump_server/bin/chronojumpServer.dll         |  Bin 276480 -> 276480 bytes
 chronojump_server/chronojumpServerCSharp.cs        |    6 ++-
 chronojump_server/howto_server_2009.txt            |   14 +++++-
 .../r-sqlite/heights_by_jumps_boxplot.R            |   30 ++++++++++++
 chronojump_server/r-sqlite/persons.R               |   47 ++++++++++++++++++++
 chronojump_server/r-sqlite/r-sqlite_script_1.txt   |   12 -----
 .../r-sqlite/tv_by_level_sex_jumptype.R            |   37 +++++++++++++++
 glade/chronojump.glade                             |   30 +++++++------
 8 files changed, 147 insertions(+), 29 deletions(-)
---
diff --git a/chronojump_server/bin/chronojumpServer.dll b/chronojump_server/bin/chronojumpServer.dll
index 786c4b7..4060ed9 100755
Binary files a/chronojump_server/bin/chronojumpServer.dll and b/chronojump_server/bin/chronojumpServer.dll differ
diff --git a/chronojump_server/chronojumpServerCSharp.cs b/chronojump_server/chronojumpServerCSharp.cs
index c2d2926..d1d3f30 100755
--- a/chronojump_server/chronojumpServerCSharp.cs
+++ b/chronojump_server/chronojumpServerCSharp.cs
@@ -114,7 +114,7 @@ public class ChronojumpServer {
 	public string [] Stats()
 	{
 		string [] stats = SqliteServer.Stats();
-
+		
 		return stats;	
 	}
 
@@ -124,6 +124,8 @@ public class ChronojumpServer {
 		Console.WriteLine(mySession.ToString());
 	
 		int id = mySession.InsertAtDB(false, Constants.SessionTable);
+
+		File.Create("need-to-update-r-graphs");
 	
 		return id; //uniqueID of person at server
 	}
@@ -133,6 +135,8 @@ public class ChronojumpServer {
 	{
 		SqliteServerSession.UpdateUploadingState(sessionID, state);
 		
+		File.Create("need-to-update-r-graphs");
+			
 		return 1;
 	}
 	
diff --git a/chronojump_server/howto_server_2009.txt b/chronojump_server/howto_server_2009.txt
index 56eef94..c9be547 100644
--- a/chronojump_server/howto_server_2009.txt
+++ b/chronojump_server/howto_server_2009.txt
@@ -1,3 +1,13 @@
+--- update 15 gen 2010 ---
+
+he actualitzat el chronojumpServerCsharp.cs
+no he canviat res que afecti a les crides, he canviat dins una funcio (si hagues canviat alguna cosa de les crides, caldria compilar el client amb el proxy baixat de la web (passos 3-5)
+he fet make i make install des del el dir de chronojump
+ha actualitzat el dll
+el pujo, paro el server i l'arranco
+----------------
+
+
 
 1.- compile bin/*.dll file
 
@@ -22,8 +32,8 @@ exit
 
 
 then we can exit without problems with the enter, and without process getting hanged, and without using the non-stop
-if(chronojumpServerCSharp.cs methods or callings don't changed) {
-	go to (6.- compile client)
+if(chronojumpServerCSharp.cs callings don't changed) {
+	go to (6.- compile client, or maybe don't need to compile client)
 }
 
 
diff --git a/chronojump_server/r-sqlite/heights_by_jumps_boxplot.R b/chronojump_server/r-sqlite/heights_by_jumps_boxplot.R
new file mode 100644
index 0000000..1ad89fd
--- /dev/null
+++ b/chronojump_server/r-sqlite/heights_by_jumps_boxplot.R
@@ -0,0 +1,30 @@
+library(GDD)
+GDD(file="/var/www/web/server/images/heights_by_jumps_boxplot.png",
+  width = 670, height= 670, ps = 12, type="png")
+library(RSQLite)
+drv <- dbDriver("SQLite")
+file = "/root/.local/share/Chronojump/database/chronojump_server.db"
+con <- dbConnect(drv, file)
+
+jumps <- dbGetQuery(con, "select person.sex, jump.* from person, jump where person.uniqueID == jump.personID")
+jumpsM <- subset(jumps, jumps$sex=="M")
+jumpsF <- subset(jumps, jumps$sex=="F")
+
+par(mfrow=c(2,1))
+
+ntypes <- length(levels(as.factor (jumpsM$type)))
+bp=boxplot(jumpsM$tv ~ jumpsM$type, las=2, col=terrain.colors(ntypes))
+text(1:ntypes, .4, paste("n=",format(bp$n),sep=""), xpd = TRUE, col = "grey20", cex=0.8)
+title(main="Heights by jumps in males")
+
+ntypes <- length(levels(as.factor (jumpsF$type)))
+bp=boxplot(jumpsF$tv ~ jumpsF$type, las=2, col=cm.colors(ntypes))
+text(1:ntypes, .4, paste("n=",format(bp$n),sep=""), xpd = TRUE, col = "grey20", cex=0.8)
+title(main="Heights by jumps in females",
+  sub=paste(Sys.Date(),"(YYYY-MM-DD)"), cex.sub = 0.75, font.sub = 3, col.sub = "red")
+
+par(mfrow=c(1,1))
+
+dev.off()
+
+
diff --git a/chronojump_server/r-sqlite/persons.R b/chronojump_server/r-sqlite/persons.R
new file mode 100644
index 0000000..ca06c4b
--- /dev/null
+++ b/chronojump_server/r-sqlite/persons.R
@@ -0,0 +1,47 @@
+library(GDD)
+GDD(file="/var/www/web/server/images/persons.png", type="png", w=670, h=670)
+library(RSQLite)
+drv = dbDriver("SQLite")
+file = "/root/.local/share/Chronojump/database/chronojump_server.db"
+con = dbConnect(drv, file)
+
+def.par <- par(no.readonly = TRUE) # save default, for resetting...
+
+
+persons <- dbGetQuery(con, "select sport.name as sport, speciallity.name as speciallity, country.name as country, person.sex as sex, person.practice as level from person, country, sport, speciallity where person.countryID = country.uniqueID and person.sportID == sport.uniqueID and person.speciallityID=speciallity.uniqueID")
+
+persons$sportF<-factor(persons$sport)
+#persons$speciallityF<-factor(persons$speciallity)
+persons$countryF<-factor(persons$country)
+persons$sexF<-factor(persons$sex)
+persons$levelF<-factor(persons$level)
+
+par(new=FALSE, oma=c(1,1,5,1))
+#par(mfcol=c(2,2))
+nf <- layout(matrix(c(1,1,1,2,3,4), 3, 2, byrow=FALSE), respect=TRUE)
+#layout.show(nf)
+
+dotchart(table(persons$sportF)[order (table(persons$sportF))], labels=levels(persons$sportF)[order (table(persons$sportF))], main="Sport")
+#dotchart(table(persons$speciallityF), labels=levels(persons$speciallityF), main="athletics speciallities")
+#SPECIALLITIES fer amb un altre select i nomes d'atletisme
+
+dotchart(table(persons$countryF)[order (table(persons$countryF))], labels=levels(persons$countryF)[order (table(persons$countryF))], main="Country")
+
+pie(table(persons$sexF), labels=levels(persons$sexF), main="Sex",
+  col=rainbow(length(levels(persons$sexF))))
+
+levels(persons$levelF)=c("Sedentary", "Regular practice", "Competition", "Elite") #undefined is impossible on server
+  pie(table(persons$levelF), main="Level", col=rainbow(length(levels(persons$levelF))))
+
+  #par(mfcol=c(1,1))
+  par(def.par)#- reset to default
+
+par(new=TRUE)
+plot(-1,type="n",axes=F,xlab='',ylab='')
+title(main="Persons data in server",
+  sub=paste(Sys.Date(),"(YYYY-MM-DD)"), cex.sub = 0.75, font.sub = 3, col.sub = "red")
+
+  dev.off()
+
+
+
diff --git a/chronojump_server/r-sqlite/tv_by_level_sex_jumptype.R b/chronojump_server/r-sqlite/tv_by_level_sex_jumptype.R
new file mode 100644
index 0000000..a9071d0
--- /dev/null
+++ b/chronojump_server/r-sqlite/tv_by_level_sex_jumptype.R
@@ -0,0 +1,37 @@
+library(GDD)
+GDD(file="/var/www/web/server/images/tv_by_level_sex_jumptype.png", type="png", w=670, h=670)
+library(RSQLite)
+drv = dbDriver("SQLite")
+file = "/root/.local/share/Chronojump/database/chronojump_server.db"
+con = dbConnect(drv, file)
+
+jumps <- dbGetQuery(con, "select person.sex as sex, person.practice as level, jump.* from person, jump where level>=0 and simulated>=0 and person.uniqueID == jump.personID")
+
+jumps$sexF <- factor(jumps$sex, levels=c('M','F'), ordered=TRUE)
+jumps$typeF <- factor(jumps$type)
+
+library(car)
+jumps$sexNum <- recode(jumps$sexF, '"M" = .1; "F" = -.1; ',
+  as.factor.result=FALSE)
+
+
+  library(lattice)
+  cols=c(topo.colors(4)[1], topo.colors(4)[2])
+     par(pch=19, col=cols, cex.sub=0.75, font.sub=3, col.sub="red")
+  xyplot(tv ~ (level+sexNum) |  typeF, groups=sexF,
+     #simpleTheme don't work in R 2.7.1
+     #par.settings = simpleTheme(pch=19,col=cols),
+     scales=list(x=list(tick.number=3, relation='same'),
+     y=list(relation='same')),
+     xlab="level",
+     pch=19, col=cols,
+     auto.key=list(border=FALSE, text=c("Males", "Females"), col=cols, points = FALSE),
+       #title="TV by level, sex and jump type", sub="hola"),
+       main="TV by level, sex and jump type",
+        sub=paste(Sys.Date(),"(YYYY-MM-DD)"), cex.sub = 0.75, font.sub = 3, col.sub = "red",
+     #key=list(title(main="TV by level, sex and jump type",
+     #   sub=paste(Sys.Date(),"(YYYY-MM-DD)"), cex.sub = 0.75, font.sub = 3, col.sub = "red")),
+     data=jumps)
+
+  dev.off()
+
diff --git a/glade/chronojump.glade b/glade/chronojump.glade
index d0e1a02..6b4765b 100644
--- a/glade/chronojump.glade
+++ b/glade/chronojump.glade
@@ -7518,8 +7518,8 @@ suitable for agility tests)</property>
                                         <property name="receives_default">False</property>
                                         <property name="tooltip" translatable="yes">Edit selected person (E)</property>
                                         <signal name="clicked" handler="on_edit_current_person_clicked"/>
-                                        <accelerator key="e" signal="clicked" modifiers="GDK_SHIFT_MASK"/>
                                         <accelerator key="E" signal="clicked"/>
+                                        <accelerator key="e" signal="clicked" modifiers="GDK_SHIFT_MASK"/>
                                         <child>
                                           <widget class="GtkImage" id="image1977">
                                             <property name="visible">True</property>
@@ -17407,6 +17407,7 @@ comments</property>
     <child>
       <widget class="GtkVBox" id="vbox147">
         <property name="visible">True</property>
+        <property name="orientation">vertical</property>
         <property name="spacing">8</property>
         <child>
           <widget class="GtkScrolledWindow" id="scrolledwindow36">
@@ -17722,6 +17723,7 @@ times</property>
             <child>
               <widget class="GtkVBox" id="vbox150">
                 <property name="visible">True</property>
+                <property name="orientation">vertical</property>
                 <child>
                   <widget class="GtkLabel" id="label_uploaded_sports">
                     <property name="visible">True</property>
@@ -17752,7 +17754,7 @@ times</property>
             <child>
               <widget class="GtkLabel" id="label_thanks">
                 <property name="visible">True</property>
-                <property name="label" translatable="yes">&lt;i&gt;Thanks for your time.&lt;/i&gt;</property>
+                <property name="label" translatable="yes">Thanks for your time.  Graphs will be updated on server at 3h7min UTC.</property>
                 <property name="use_markup">True</property>
               </widget>
               <packing>
@@ -20421,18 +20423,6 @@ by you</property>
               </packing>
             </child>
             <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
-              <placeholder/>
-            </child>
-            <child>
               <widget class="GtkButton" id="button_connect_cp2">
                 <property name="label" translatable="yes">Connect</property>
                 <property name="visible">True</property>
@@ -20477,6 +20467,18 @@ by you</property>
                 <property name="bottom_attach">5</property>
               </packing>
             </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
+            <child>
+              <placeholder/>
+            </child>
           </widget>
           <packing>
             <property name="position">0</property>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]