Changeset 7166 for trunk/MagicSoft/Mars/datacenter/macros
- Timestamp:
- 06/15/05 14:45:27 (20 years ago)
- Location:
- trunk/MagicSoft/Mars/datacenter/macros
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/macros/createdataset.C
r7164 r7166 82 82 fouthtml << source << endl; 83 83 fouthtml << "</td><td>" << endl; 84 if (wobble.Contains("Y")) 85 fouthtml << "wobble," << endl; 84 86 if (startdate=="0000-00-00 00:00:00") 85 87 fouthtml << "all" << endl; … … 121 123 delete res; 122 124 123 if (off.Contains("none")) 124 { 125 cout << "no off chosen" << endl; 126 if (wobble.Contains("Y")) 125 if (wobble.Contains("N")) 126 { 127 if (off.Contains("none")) 127 128 { 128 cout << "wobble mode -> finished" << endl; 129 return 1; 129 off ="Off"; 130 off +=source; 131 off.Remove(10,15); 130 132 } 131 off ="Off"; 132 off +=source.Remove(7,12); 133 } 134 135 cout << "off: " << off << endl; 136 query ="Select Sequences.fSequenceFirst from Sequences left join Source on "; 137 query +="Sequences.fSourceKEY=Source.fSourceKEY "; 138 if (cal) 139 query +=" left join SequenceProcessStatus on Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst "; 140 query +=Form("where fSourceName like '%s%%' and fRunStart between '%s' and '%s'", 141 off.Data(), offstartdate.Data(), offstopdate.Data()); 142 if (cal) 143 query +=" and not IsNull(fStar) "; 144 query +=" order by Sequences.fSequenceFirst "; 145 146 cout << "Q: " << query << endl; 147 148 res = serv.Query(query); 149 if (!res) 150 { 151 cout << "Error - no sequence found" << endl; 152 return 0; 153 } 154 155 fout << "SequencesOff: " << flush; 156 row=0; 157 while ((row = res->Next())) 158 fout << " " << (*row)[0] << " " << flush; 159 fout << endl << endl; 160 161 fout << "#SourceName: " << source << endl; 133 134 cout << "off: " << off << endl; 135 query ="Select Sequences.fSequenceFirst from Sequences left join Source on "; 136 query +="Sequences.fSourceKEY=Source.fSourceKEY "; 137 if (cal) 138 query +=" left join SequenceProcessStatus on Sequences.fSequenceFirst=SequenceProcessStatus.fSequenceFirst "; 139 query +=Form("where fSourceName like '%s%%' and fRunStart between '%s' and '%s'", 140 off.Data(), offstartdate.Data(), offstopdate.Data()); 141 if (cal) 142 query +=" and not IsNull(fStar) "; 143 query +=" order by Sequences.fSequenceFirst "; 144 145 cout << "Q: " << query << endl; 146 147 res = serv.Query(query); 148 if (!res) 149 { 150 cout << "Error - no sequence found" << endl; 151 return 0; 152 } 153 154 fout << "SequencesOff: " << flush; 155 row=0; 156 while ((row = res->Next())) 157 fout << " " << (*row)[0] << " " << flush; 158 fout << endl << endl; 159 160 delete res; 161 } 162 163 if (wobble.Contains("N")) 164 fout << "#" << flush; 165 fout << "SourceName: " << source << endl; 162 166 fout << "Catalog: /magic/datacenter/setup/magic_favorites.edb" << endl; 163 167 if (wobble.Contains("N")) … … 165 169 fout << "WobbleMode: On" << endl << endl; 166 170 167 delete res;168 171 169 172 return 1; 170 173 } 171 174 175 int createdataset(TString filename) 176 { 177 ifstream fin(filename); 178 if (!fin) 179 { 180 cout << "Could not open file " << filename << endl; 181 return 0; 182 } 183 cout << "reading file " << filename << endl; 184 185 while (1) 186 { 187 TString strng; 188 strng.ReadToDelim(fin, ','); 189 if (!fin) 190 break; 191 192 if (strng.BeginsWith("#")) 193 { 194 cout << "comment line: " << strng << endl; 195 strng.ReadToDelim(fin, '\n'); 196 continue; 197 } 198 199 Int_t dataset=atoi(strng.Data()); 200 if (dataset==0) 201 continue; 202 cout << "creating dataset # " << dataset << endl; 203 204 TString source; 205 source.ReadToDelim(fin, ','); 206 TString wobble; 207 wobble.ReadToDelim(fin, ','); 208 strng.ReadToDelim(fin, ','); 209 Bool_t cal=kFALSE; 210 if (strng=="kTRUE") 211 cal=kTRUE; 212 TString startdate; 213 startdate.ReadToDelim(fin, ','); 214 TString stopdate; 215 stopdate.ReadToDelim(fin, ','); 216 TString off; 217 off.ReadToDelim(fin, ','); 218 TString offstartdate; 219 offstartdate.ReadToDelim(fin, ','); 220 TString offstopdate; 221 offstopdate.ReadToDelim(fin, '\n'); 222 223 cout << createdataset(dataset, source, wobble, cal, startdate, stopdate, off, offstartdate, offstopdate) << endl; 224 } 225 226 return 1; 227 } -
trunk/MagicSoft/Mars/datacenter/macros/insertdataset.C
r7112 r7166 121 121 cout << endl; 122 122 123 Int_t sourcekey = QueryNameKEY(serv, dummy, "Source", source.Data() );123 Int_t sourcekey = QueryNameKEY(serv, dummy, "Source", source.Data(), kFALSE); 124 124 if (sourcekey<0) 125 125 { 126 cout << "Error - could not get sourcename from DB" << endl; 126 cout << "Error - could not get sourcename from DB -> " << flush; 127 cout << "maybe you have the wrong sourcename in your datasetfile" << endl; 127 128 return 0; 128 129 }
Note:
See TracChangeset
for help on using the changeset viewer.