Index: trunk/MagicSoft/Mars/Changelog
===================================================================
--- trunk/MagicSoft/Mars/Changelog	(revision 7628)
+++ trunk/MagicSoft/Mars/Changelog	(revision 7629)
@@ -18,4 +18,11 @@
 
                                                  -*-*- END OF LINE -*-*-
+
+ 2006/04/07 Daniel Hoehne, Daniela Dorner
+
+   * datacenter/macros/filldotrun.C, buildsequenceentries.C, setupdb.C:
+     - implemented new arehucas version
+
+
 
  2006/04/06 Daniela Dorner
Index: trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C	(revision 7628)
+++ trunk/MagicSoft/Mars/datacenter/macros/buildsequenceentries.C	(revision 7629)
@@ -463,5 +463,6 @@
                  " fL1TriggerTableKEY, fL2TriggerTableKEY,"
                  " fHvSettingsKEY, fDiscriminatorThresholdTableKEY,"
-                 " fTriggerDelayTableKEY, fLightConditionsKEY, fTestFlagKEY"
+                 " fTriggerDelayTableKEY, fLightConditionsKEY, "
+                 " fTestFlagKEY, fObservationModeKEY "
                  " FROM RunData"
                  " WHERE fRunTypeKEY=2 AND fExcludedFDAKEY=1 AND (fRunNumber BETWEEN %d AND %d)"
@@ -496,5 +497,6 @@
     query1+=Form(" fTriggerDelayTableKEY=%s,", (*row)[6]);
     query1+=Form(" fLightConditionsKEY=%s,", (*row)[7]);
-    query1+=Form(" fTestFlagKEY=%s, fManuallyChangedKEY=1", (*row)[8]);
+    query1+=Form(" fTestFlagKEY=%s, ", (*row)[8]);
+    query1+=Form(" fObservationModeKEY=%s, fManuallyChangedKEY=1", (*row)[9]);
 
 
@@ -810,5 +812,5 @@
 
     //get all values from the database, that are relevant for building sequences
-    TString query(Form("SELECT fRunNumber, fSourceKEY, fProjectKEY, fHvSettingsKEY,  fLightConditionsKEY, fDiscriminatorThresholdTableKEY, fTriggerDelayTableKEY FROM RunData WHERE %s AND fExcludedFDAKEY=1 order by fRunNumber", cond.Data()));
+    TString query(Form("SELECT fRunNumber, fSourceKEY, fProjectKEY, fHvSettingsKEY,  fLightConditionsKEY, fDiscriminatorThresholdTableKEY, fTriggerDelayTableKEY, fObservationModeKEY FROM RunData WHERE %s AND fExcludedFDAKEY=1 order by fRunNumber", cond.Data()));
 
     TSQLResult *res = serv.Query(query);
@@ -819,5 +821,5 @@
     //for each block the first and the last run are stored in a TExMap
     //the values are checked with the help of an array of TStrings
-    TString keys[6]= { "NULL", "NULL", "NULL", "NULL", "NULL", "NULL" };
+    TString keys[7]= { "NULL", "NULL", "NULL", "NULL", "NULL", "NULL" , "NULL" };
     TString stop     = "NULL";
     TString runstart = "NULL";
@@ -833,10 +835,10 @@
         if (count==0)
         {
-            for (Int_t i=1 ; i<7 ; i++)
+            for (Int_t i=1 ; i<8 ; i++)
                 keys[i-1]=(*row)[i];
             runstart=(*row)[0];
         }
 
-        for (Int_t i=1 ; i<7 ; i++)
+        for (Int_t i=1 ; i<8 ; i++)
         {
             runbegin=atoi(runstart.Data());
@@ -854,5 +856,5 @@
             blocks.Add((ULong_t)blocks.GetSize(), (Long_t)runbegin, (Long_t)runend);
             runstart=(*row)[0];
-            for (Int_t i=1 ; i<7 ; i++)
+            for (Int_t i=1 ; i<8 ; i++)
                 keys[i-1]=(*row)[i];
             break;
Index: trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C	(revision 7628)
+++ trunk/MagicSoft/Mars/datacenter/macros/filldotrun.C	(revision 7629)
@@ -38,5 +38,6 @@
 //   041113-0, 041209-0, 041221-0
 //   050224-0, 050317-0, 050322-0, 050401-0, 050413-0, 050415-0, 050714-0,
-//     050719-0, 050829-0, 051025-0
+//     050719-0, 050829-0, 051025-0,
+//   060330-0
 //
 // Usage:
@@ -187,5 +188,6 @@
         version!=200504010 && version!=200504130 && version!=200504150 &&
         version!=200507140 && version!=200507190 && version!=200508290 &&
-        version!=200510250)
+        version!=200510250 &&
+        version!=200603300)
     {
         cout << filename << ": File Version unknown - please update the macro!" << endl;
@@ -406,5 +408,5 @@
             default:
                 {
-                    cout << "WARNING: neiter L1 nor L2 Trigger table - please check what is happening." << strng << endl;
+                    cout << "WARNING: neither L1 nor L2 Trigger table - please check what is happening." << strng << endl;
                     break;
                 }
@@ -456,5 +458,5 @@
             || version==200504010 || version==200504130 || version==200504150
             || version==200507140 || version==200507190 || version==200508290
-            || version==200510250)
+            || version==200510250 || version==200603300)
         {
             // ========== Col 19-35: DC and HV-values, mjd =========
@@ -512,10 +514,17 @@
             }
 
-            // ========== Col 40,41: RA and Dec sent to drive =========
+            // ========== Col 40,41: Telescope RA and Dec sent to drive =========
             strng.ReadToDelim(fin, ' ');
             strng.ReadToDelim(fin, ' ');
 
             // ========== Col 42: Calibration Script =========
-            strng.ReadToDelim(fin, '\n');
+            if (version==200411130 || version==200412090 || version==200412210
+                || version==200502240 || version==200503170 || version==200503220
+                || version==200504010 || version==200504130 || version==200504150
+                || version==200507140 || version==200507190 || version==200508290
+                || version==200510250)
+                strng.ReadToDelim(fin, '\n');
+            else
+                strng.ReadToDelim(fin, ' ');
             if (strng.Contains("???"))
                 strng="n/a";
@@ -528,4 +537,27 @@
             }
 
+        }
+
+        Int_t observationmodekey=1;
+        if (version==200603300)
+        {
+            // ========== Col 43: Observation Mode =========
+            strng.ReadToDelim(fin, ' ');
+            if (strng.Contains("???"))
+                strng="n/a";
+
+            observationmodekey = QueryNameKEY(serv, dummy, "ObservationMode", strng.Data());
+            if (observationmodekey<0)
+            {
+                strng.ReadLine(fin);
+                continue;
+            }
+
+            // ========== Col 44-51: Source RA and Dec, DT's and IPR =========
+            for (int i=0 ; i<7 ; i++)
+            {
+                strng.ReadToDelim(fin, ' ');
+            }
+            strng.ReadToDelim(fin, '\n');
         }
 
@@ -554,4 +586,5 @@
         query += Form("fLightConditionsKEY=%d, ", lightcondkey);
         query += Form("fHvSettingsKEY=%d, ", hvkey);
+        query += Form("fObservationModeKEY=%d, ", observationmodekey);
         if (!TMath::IsNaN(zd) && TMath::Finite(zd))
             query += Form("fZenithDistance=%d, ", TMath::Nint(zd));
Index: trunk/MagicSoft/Mars/datacenter/macros/setupdb.C
===================================================================
--- trunk/MagicSoft/Mars/datacenter/macros/setupdb.C	(revision 7628)
+++ trunk/MagicSoft/Mars/datacenter/macros/setupdb.C	(revision 7629)
@@ -254,4 +254,9 @@
         "INSERT MyMagic.DiscriminatorThresholdTable (fDiscriminatorThresholdTableKEY, fDiscriminatorThresholdTableName, fDiscriminatorThresholdTable) VALUES "
         "  (1, 'n/a', 'Discriminator threshold table is not available')"));
+
+    // Observation Mode
+    list.Add(new TObjString(
+        "INSERT MyMagic.ObservationMode (fObservationModeKEY, fObservationModeName, fObservationMode) VALUES "
+        "  (1, 'n/a', 'Not available')"));
 
 
@@ -330,4 +335,5 @@
         "  fDiscriminatorThresholdTableKEY  SMALLINT  UNSIGNED   NOT NULL,"
         "  fTriggerDelayTableKEY            SMALLINT  UNSIGNED   NOT NULL,"
+        "  fObservationModeKEY              SMALLINT  UNSIGNED   NOT NULL,"
         ")";
 
@@ -419,4 +425,5 @@
     list.Add(CreateKeyTable("DiscriminatorThresholdTable"));
     list.Add(CreateKeyTable("TriggerDelayTable"));
+    list.Add(CreateKeyTable("ObservationMode"));
 
     list.Add(new TObjString(
@@ -530,4 +537,5 @@
          "  fDiscriminatorThresholdTableKEY  SMALLINT  UNSIGNED   NOT NULL,"
          "  fTriggerDelayTableKEY            SMALLINT  UNSIGNED   NOT NULL,"
+         "  fObservationModeKEY              SMALLINT  UNSIGNED   NOT NULL,"
          ")";
 
