예제 #1
0
// use smartcull on all charges
void CMSPeak::CullAll(const CMSSearchSettings& Settings)
{    
    int iCharges;
    SetPeakLists()[eMSPeakListOriginal]->Sort(eMSPeakListSortIntensity);

    CullChargeAndWhich(Settings);

    // make the high intensity list
    // todo: need to look at all of the filtered lists to pick out peaks 
    // found in all filtered list -- otherwise you'll get precursors
    // also, SmartCull has to adjust for charge!
    iCharges = GetNumCharges() - 1;
    int Which = GetWhich(GetCharges()[iCharges]);
    CMZI *Temp = new CMZI [SetPeakLists()[Which]->GetNum()]; // temporary holder
    copy(SetPeakLists()[Which]->GetMZI(), SetPeakLists()[Which]->GetMZI() + 
         SetPeakLists()[Which]->GetNum(), Temp);
    sort(Temp, Temp + SetPeakLists()[Which]->GetNum(), CMZICompareIntensity());

    if(SetPeakLists()[Which]->GetNum() > Settings.GetTophitnum())  
        SetPeakLists()[eMSPeakListTop]->CreateLists(Settings.GetTophitnum());
    else 
        SetPeakLists()[eMSPeakListTop]->CreateLists(SetPeakLists()[Which]->GetNum());

    copy(Temp, Temp + SetPeakLists()[eMSPeakListTop]->GetNum(), 
         SetPeakLists()[eMSPeakListTop]->GetMZI());
    SetPeakLists()[eMSPeakListTop]->Sort(eMSPeakListSortMZ);

    delete [] Temp;
}
예제 #2
0
void CMSPeak::CullChargeAndWhich(const CMSSearchSettings& Settings)
{
    int iCharges;
	for(iCharges = 0; iCharges < GetNumCharges(); iCharges++){
        int TempLen(0);
        CMZI *Temp = new CMZI [GetPeakLists()[eMSPeakListOriginal]->GetNum()]; // temporary holder
        copy(SetPeakLists()[eMSPeakListOriginal]->GetMZI(), 
             SetPeakLists()[eMSPeakListOriginal]->GetMZI() + 
             GetPeakLists()[eMSPeakListOriginal]->GetNum(), Temp);
        TempLen = GetPeakLists()[eMSPeakListOriginal]->GetNum();
        bool ConsiderMultProduct(false);

		CullPrecursor(Temp,
                      TempLen,
                      CalcPrecursorMass(GetCharges()[iCharges]),
                      GetCharges()[iCharges],
                      Settings.GetPrecursorcull() != 0,
                      Settings.GetChargehandling().GetNegative());

//#define DEBUG_PEAKS1
#ifdef DEBUG_PEAKS1
    {
	sort(Temp, Temp+TempLen , CMZICompare());
	ofstream FileOut("afterprecurse.dta");
	xWrite(FileOut, Temp, TempLen);
	sort(Temp, Temp+TempLen , CMZICompareIntensity());
    }
#endif

        if(GetCharges()[iCharges] >= ConsiderMult) ConsiderMultProduct = true;

    	SmartCull(Settings,
    			  Temp, TempLen, ConsiderMultProduct);
    
        // make the array of culled peaks
    	EMSPeakListTypes Which = GetWhich(GetCharges()[iCharges]);
        SetPeakLists()[Which]->CreateLists(TempLen);
        copy(Temp, Temp+TempLen, SetPeakLists()[Which]->GetMZI());
        SetPeakLists()[Which]->Sort(eMSPeakListSortIntensity);
        SetPeakLists()[Which]->Rank();
        SetPeakLists()[Which]->Sort(eMSPeakListSortMZ);

        delete [] Temp;
	}
}
예제 #3
0
파일: corpse.cpp 프로젝트: Zephyr800/Server
void Corpse::MoveItemToCorpse(Client *client, ItemInst *inst, int16 equipSlot, std::list<uint32> &removedList)
{
	AddItem(
		inst->GetItem()->ID,
		inst->GetCharges(),
		equipSlot,
		inst->GetAugmentItemID(0),
		inst->GetAugmentItemID(1),
		inst->GetAugmentItemID(2),
		inst->GetAugmentItemID(3),
		inst->GetAugmentItemID(4),
		inst->GetAugmentItemID(5),
		inst->IsAttuned()
		);
	removedList.push_back(equipSlot);

	while (true) {
		if (!inst->IsType(ItemClassContainer)) { break; }
		if (equipSlot < EmuConstants::GENERAL_BEGIN || equipSlot > MainCursor) { break; }

		for (auto sub_index = SUB_BEGIN; sub_index < EmuConstants::ITEM_CONTAINER_SIZE; ++sub_index) {
			int16 real_bag_slot = Inventory::CalcSlotId(equipSlot, sub_index);
			auto bag_inst = client->GetInv().GetItem(real_bag_slot);
			if (bag_inst == nullptr) { continue; }

			AddItem(
				bag_inst->GetItem()->ID,
				bag_inst->GetCharges(),
				real_bag_slot,
				bag_inst->GetAugmentItemID(0),
				bag_inst->GetAugmentItemID(1),
				bag_inst->GetAugmentItemID(2),
				bag_inst->GetAugmentItemID(3),
				bag_inst->GetAugmentItemID(4),
				bag_inst->GetAugmentItemID(5),
				bag_inst->IsAttuned()
				);
			removedList.push_back(real_bag_slot);
			client->DeleteItemInInventory(real_bag_slot, 0, true, false);
		}
		break;
	}
	client->DeleteItemInInventory(equipSlot, 0, true, false);
}
예제 #4
0
void Corpse::MoveItemToCorpse(Client *client, EQEmu::ItemInstance *inst, int16 equipSlot, std::list<uint32> &removedList)
{
	AddItem(
		inst->GetItem()->ID,
		inst->GetCharges(),
		equipSlot,
		inst->GetAugmentItemID(0),
		inst->GetAugmentItemID(1),
		inst->GetAugmentItemID(2),
		inst->GetAugmentItemID(3),
		inst->GetAugmentItemID(4),
		inst->GetAugmentItemID(5),
		inst->IsAttuned()
		);
	removedList.push_back(equipSlot);

	while (true) {
		if (!inst->IsClassBag()) { break; }
		if (equipSlot < EQEmu::legacy::GENERAL_BEGIN || equipSlot > EQEmu::inventory::slotCursor) { break; }

		for (int16 sub_index = EQEmu::inventory::containerBegin; sub_index < EQEmu::inventory::ContainerCount; ++sub_index) {
			int16 real_bag_slot = EQEmu::InventoryProfile::CalcSlotId(equipSlot, sub_index);
			auto bag_inst = client->GetInv().GetItem(real_bag_slot);
			if (bag_inst == nullptr) { continue; }

			AddItem(
				bag_inst->GetItem()->ID,
				bag_inst->GetCharges(),
				real_bag_slot,
				bag_inst->GetAugmentItemID(0),
				bag_inst->GetAugmentItemID(1),
				bag_inst->GetAugmentItemID(2),
				bag_inst->GetAugmentItemID(3),
				bag_inst->GetAugmentItemID(4),
				bag_inst->GetAugmentItemID(5),
				bag_inst->IsAttuned()
				);
			removedList.push_back(real_bag_slot);
			client->DeleteItemInInventory(real_bag_slot, 0, true, false);
		}
		break;
	}
	client->DeleteItemInInventory(equipSlot, 0, true, false);
}