Changeset 19507
- Timestamp:
- 05/25/19 13:52:01 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/gcn.cc
r19498 r19507 59 59 } 60 60 61 GCN::Paket Type_tGetType(const QDomElement &what)61 GCN::PaketPtr GetType(const QDomElement &what) 62 62 { 63 63 const auto value = GetParamValue(what, "Packet_Type"); 64 64 if (value.isEmpty()) 65 return { -1, "", "" };65 return GCN::PaketTypes.end(); 66 66 67 67 const uint16_t val = value.toUInt(); 68 const auto it = fTypes.find(val); 69 if (it!=fTypes.end()) 70 return it->second; 71 72 Warn("Unknown paket type "+to_string(val)+"."); 73 return { -1, "", "" }; 68 69 const auto it = GCN::PaketTypes.find(val); 70 71 if (it==GCN::PaketTypes.end()) 72 Warn("Unknown paket type "+to_string(val)+"."); 73 74 return it; 75 74 76 } 75 77 … … 126 128 return -1; 127 129 128 const GCN::PaketType_tptype = GetType(what);130 const auto ptype = GetType(what); 129 131 130 132 const QDomElement date = who.firstChildElement("Date"); … … 146 148 const QDomElement errad = pos2d.firstChildElement("Error2Radius"); 147 149 148 const bool is_gw = ptype.type==150 || ptype.type==151 || ptype.type==152 || ptype.type==153 || ptype.type==164; 150 const auto &id = ptype->first; 151 152 const bool is_gw = id==150 || id==151 || id==152 || id==153 || id==164; 149 153 150 154 vector<string> missing; … … 234 238 */ 235 239 240 const auto &paket = ptype->second; 241 236 242 const string unit = pos2d.attribute("unit").toStdString(); 237 243 … … 247 253 if (!desc.isNull()) 248 254 Out() << "[" << desc.text().toStdString() << "]\n"; 249 Out() << p type.name << "[" << ptype.type << "]: " << ptype.description << endl;255 Out() << paket.name << "[" << id << "]: " << paket.description << endl; 250 256 Out() << left; 251 257 Out() << " " << setw(5) << "TIME" << "= " << Time(time.text().toStdString()).GetAsStr() << '\n'; … … 256 262 const bool has_coordinates = n1=="RA" && n2=="Dec" && unit=="deg"; 257 263 258 if (has_coordinates) 264 const std::set<int16_t> typelist = 265 { 266 51, // INTEGRAL_POINTDIR 267 268 53, // INTEGRAL_WAKEUP 269 54, // INTEGRAL_REFINED 270 55, // INTEGRAL_OFFLINE 271 272 // 56, // INTEGRAL_WEAK 273 // 59, // KONUS_LC 274 275 60, // SWIFT_BAT_GRB_ALERT 276 61, // SWIFT_BAT_GRB_POS_ACK 277 62, // SWIFT_BAT_GRB_POS_NACK 278 279 83, // SWIFT_POINTDIR 280 281 97, // SWIFT_BAT_QL_POS 282 283 100, // AGILE_GRB_WAKEUP 284 101, // AGILE_GRB_GROUND 285 102, // AGILE_GRB_REFINED 286 287 110, // FERMI_GBM_FLT_POS 288 111, // FERMI_GBM_GND_POS 289 112, // FERMI_GBM_LC 290 115, // FERMI_GBM_TRANS 291 292 123, // FERMI_LAT_TRANS 293 125, // FERMI_LAT_MONITOR 294 295 // 134, // MAXI_UNKNOWN 296 // 135, // MAXI_KNOWN 297 // 136, // MAXI_TEST 298 299 157, // AMON_ICECUBE_COINC 300 158, // AMON_ICECUBE_HESE 301 302 169, // AMON_ICECUBE_EHE 303 171, // HAWC_BURST_MONITOR 304 173, // ICECUBE_GOLD 305 174, // ICECUBE_BRONZE 306 }; 307 308 const bool valid = typelist.find(id)!=typelist.end(); 309 310 if (valid && has_coordinates) 259 311 { 260 312 const ToO::DataGRB data = 261 313 { 262 .type = ptype.type,314 .type = id, 263 315 .trigid = trig, 264 316 .ra = ra, … … 426 478 { 427 479 SetLogStream(&imp); 428 429 for (auto it=GCN::kTypes; it->type>0; it++)430 fTypes[it->type] = *it;431 480 } 432 481
Note:
See TracChangeset
for help on using the changeset viewer.