void RemoveTagTypeView::removeTagType_clicked() { QString tagtype = cbType->currentText(); for(int i=0; i < _atagger->tagTypeVector->count(); i++) { if((_atagger->tagTypeVector->at(i))->name == tagtype) { _atagger->tagTypeVector->remove(i); /// Remove all tags based on removed tag type QHashIterator<int, Tag*> iTag(*(_atagger->tagHash)); while (iTag.hasNext()) { iTag.next(); if(iTag.value()->tagtype->name == tagtype) { _atagger->tagHash->remove(iTag.value()->wordIndex,iTag.value()); } } if(_atagger->isTagMBF) { ((AMTMainWindow*)parentWidget())->applyTags(0); } break; } } this->close(); }
/* Method : readOrderEntry() Description: Reads the message type Order Entry from the binary file and increments the total packet count and also stores the Entry message count. */ void readBinaryData::readOrderEntry() { // Count the number of total packets and also Order Entry packets total_packets++; order_entry_msg_count++; order_Entry orderEntry = {}; binfile.read((char*)&orderEntry, sizeof(orderEntry)); // Get the Instrument tag std::string iTag(orderEntry.instrument); // Discard any junk characters in the tag std::string instrumentTag = iTag.substr(0, 10); // Count the Instruments, store it in a map int countIns = 0; if (Instrument_count.find(instrumentTag) == Instrument_count.end()) { Instrument_count[instrumentTag] = ++countIns; } else { countIns = Instrument_count[instrumentTag]; Instrument_count[instrumentTag] = ++countIns; } // Discard any junk characters in the tag. std::string tTag(orderEntry.trader_tag); std::string tragerTag = tTag.substr(0, 3); if (orderEntry.time_in_force == '\x2') { // Keep track of the trader with the largest GFD volume entered into the market. int countLiq = 0; if (most_liquidity_trader_tag.find(tragerTag) == most_liquidity_trader_tag.end()) { most_liquidity_trader_tag[tragerTag] = ++countLiq; } else{ countLiq = most_liquidity_trader_tag[tragerTag]; most_liquidity_trader_tag[tragerTag] = ++countLiq; } } // Keep track of the trader with the largest filled volume. int count = 0; if (most_active_trader_tag.find(tragerTag) == most_active_trader_tag.end()) { most_active_trader_tag[tragerTag] = ++count; } else{ count = most_active_trader_tag[tragerTag]; most_active_trader_tag[tragerTag] = ++count; } std::string tempStr = ""; char endByte; bool b = true; order_Entry_firm oef = {}; do{ binfile.read(reinterpret_cast<char*>(&endByte), 1); // Check if we encounter the end of message if (endByte != 'D'){ // If not then add the firm to temp string tempStr = tempStr + endByte; } else{ // On encountering the end of message string DBDBDBDB add the temp string to firm. strcpy_s(oef.firm, tempStr.c_str()); // read the remaining end of message string binfile.read(reinterpret_cast<char*>(&oef.terminationstr), sizeof(oef.terminationstr) - 1); b = false; } } while (b); }