Index: trunk/MagicSoft/Mars/datacenter/db/builddatasets.php
===================================================================
--- trunk/MagicSoft/Mars/datacenter/db/builddatasets.php	(revision 8182)
+++ trunk/MagicSoft/Mars/datacenter/db/builddatasets.php	(revision 8189)
@@ -233,5 +233,5 @@
 
         if (empty($_GET["fNumResults"]))
-            $_GET["fNumResults"]="10";
+            $_GET["fNumResults"]="100";
 
         if (empty($_GET["fRunStart"]))
@@ -262,9 +262,51 @@
             $_GET["fUnsInLimit2"]=$first?"20":"";
 
-        if (empty($_GET["fRunTimeLimit1"]))
-            $_GET["fRunTimeLimit1"]=$first?"2":"";
-
-        if (empty($_GET["fRunTimeLimit2"]))
-            $_GET["fRunTimeLimit2"]=$first?"5":"";
+//        if (empty($_GET["fRunTimeLimit1"]))
+//            $_GET["fRunTimeLimit1"]=$first?"5":"";
+
+//        if (empty($_GET["fRunTimeLimit2"]))
+//            $_GET["fRunTimeLimit2"]=$first?"2":"";
+
+        if (empty($_GET["fIMCLimit1"]))
+            $_GET["fIMCLimit1"]=$first?"00":"";
+
+        if (empty($_GET["fIsoInLimit1"]))
+            $_GET["fIsoInLimit1"]=$first?"00":"";
+
+        if (empty($_GET["fInhomLimitMean"]))
+            $_GET["fInhomLimitMean"]=$first?"10":"";
+
+        if (empty($_GET["fInhomLimitRms"]))
+            $_GET["fInhomLimitRms"]=$first?"3":"";
+
+        if (empty($_GET["fImgRateLimitMean"]))
+            $_GET["fImgRateLimitMean"]=$first?"180":"";
+
+        if (empty($_GET["fImgRateLimitRms"]))
+            $_GET["fImgRateLimitRms"]=$first?"30":"";
+
+        if (empty($_GET["fMuonRateLimitMean"]))
+            $_GET["fMuonRateLimitMean"]=$first?"1":"";
+
+        if (empty($_GET["fMuonRateLimitRms"]))
+            $_GET["fMuonRateLimitRms"]=$first?"0.2":"";
+
+        if (empty($_GET["fMuonNumLimit1"]))
+            $_GET["fMuonNumLimit1"]=$first?"180":"";
+
+        if (empty($_GET["fMuonNumLimit2"]))
+            $_GET["fMuonNumLimit2"]=$first?"120":"";
+
+        if (empty($_GET["fNumStarsLimit1"]))
+            $_GET["fNumStarsLimit1"]=$first?"30":"";
+
+        if (empty($_GET["fNumStarsLimit2"]))
+            $_GET["fNumStarsLimit2"]=$first?"20":"";
+
+        if (empty($_GET["fNumStarsCorLimit1"]))
+            $_GET["fNumStarsCorLimit1"]=$first?"10":"";
+
+        if (empty($_GET["fNumStarsCorLimit2"]))
+            $_GET["fNumStarsCorLimit2"]=$first?"5":"";
 
         if (empty($_GET["fUnreliableInner"]))
@@ -433,5 +475,4 @@
                     }
                 printf("<input type='submit' value='Get Dataset'><br><br>\n");
-                printf("pw: %s<br>", crypt("IutWDC+B"));
                 printf("<input name='submit' type='hidden' value='post'>\n");
 
@@ -501,5 +542,5 @@
 
                 //get next dataset#
-                $query="SELECT fDataSetNumber+1 FROM DataSets ORDER BY fDataSetNumber LIMIT 0,1";
+                $query="SELECT fDataSetNumber+1 FROM DataSets ORDER BY fDataSetNumber DESC LIMIT 0,1";
                 $result = mysql_query($query, $db_id);
                 $row = mysql_fetch_assoc($result);
@@ -543,4 +584,7 @@
                 $pedrmsrms=0.09;
                 $scalelimit=1.3;
+                $inhomlimit=13;
+                $numstarslimit=20;
+                $numstarscorlimit=10;
 
 
@@ -559,7 +603,16 @@
                         GetSequenceValues($db_id, ${$val}, $val, $values);
 
+                        if ($values["Min(fNumStarsCorMed)"][$val]<$numstarscorlimit)
+                            printf("<li style='color:%s'>%s: one of your %s-sequences has less than %s identified stars (%s)</li>",
+                                   $color["WARN"], "WARN", $val, $numstarscorlimit, $values["Min(fNumStarsCorMed)"][$val]);
+                        if ($values["Min(fNumStarsMed)"][$val]<$numstarslimit)
+                            printf("<li style='color:%s'>%s: one of your %s-sequences has less than %s identified stars (%s)</li>",
+                                   $color["WARN"], "WARN", $val, $numstarslimit, $values["Min(fNumStarsMed)"][$val]);
                         if ($values["Min(fRunTime)/60"][$val]<$runtimelimit)
                             printf("<li style='color:%s'>%s: one of your %s-sequences is shorter than %s min (%s min)</li>",
-                                   $color["WARN"], "WARN", $val, $runtimelimit, $values["Min(fRunTime)/60"][$val]);
+                                   $color["INFO"], "INFO", $val, $runtimelimit, $values["Min(fRunTime)/60"][$val]);
+                        if ($values["Max(fInhomogeneity)"][$val]>$inhomlimit)
+                            printf("<li style='color:%s'>%s: one of your %s-sequences has an inhomogeneity larger than %s (%s)</li>",
+                                   $color["WARN"], "WARN", $val, $inhomlimit, $values["Max(fInhomogeneity)"][$val]);
                         if ($values["Max(fUnsuitableInner)"][$val]>$unsuitablemaxlimit)
                             printf("<li style='color:%s'>%s: one of your %s-sequences has more than %s unsuitable inner pixel (%s)</li>",
@@ -655,14 +708,20 @@
                         if (!empty($_POST["insert"]) && $numerr==0)
                         {
+                            printf("Inserted Query #%s: %s<br>", $num, $q);
                             $insresult=mysql_query($q);
-                            printf("inserted query ");
-                            printf("<br> result: <br>");
-                            printf("errorno: %s <br>", mysql_errno());
-                            printf("errormsg: %s <br>", mysql_error());
-                            printf("info: %s <br>", mysql_info());
-                            printf("affected rows: %s <br>", mysql_affected_rows());
+                            if (mysql_errno()>0)
+                                printf("&nbsp; Errorno: %s <br>", mysql_errno());
+                            if (mysql_error()!="")
+                                printf("&nbsp; Errormsg: %s <br>", mysql_error());
+                            if (mysql_info()!="")
+                                printf("&nbsp; Info: %s <br>", mysql_info());
+                            printf("&nbsp; Affected Rows: %s <br>", mysql_affected_rows());
                             mysql_free_result($insresult);
+                            if (mysql_errno()>0)
+                            {
+                                printf("ERROR => stop inserting");
+                                break;
+                            }
                         }
-                        printf(" %s: %s<br>", $num, $q);
                     }
                     printf("</div>");
@@ -673,6 +732,6 @@
                     if (empty($_POST["fObservationModeKEY"]) && !empty($_GET["obsmode"]))
                         $_POST["fObservationModeKEY"]=$_GET["obsmode"];
-                    printf("Name: &nbsp;<input name='name' type='text' size='10' maxlength='12' value='%s'><br>\n", $_POST["name"]);
-                    printf("Comment: &nbsp;<input name='comment' type='text' size='20' maxlength='255' value='%s'><br>\n", $_POST["comment"]);
+                    printf("Name: &nbsp;<input name='name' type='text' size='20' maxlength='20' value='%s'><br>\n", $_POST["name"]);
+                    printf("Comment: &nbsp;<input name='comment' type='text' size='50' maxlength='255' value='%s'><br>\n", $_POST["comment"]);
 
                     $query   = "SELECT fObservationModeKEY, fObservationModeName FROM ObservationMode ORDER BY fObservationModeName";
