Exemple #1
0
//
// Updates the queue depth if necessary.
//
void CPageDisk::OnKillfocusEQueueDepth()
{
	Manager *manager;
	Worker *worker;

	// If the disk queue was left blank, use the previous value
	if (!m_EQueueDepth.LineLength()) {
		ShowSettings();
	}
	// Verify that the queue depth is > 0.
	else if (GetDlgItemInt(EQueueDepth) <= 0) {
		ErrorMessage("# of Outstanding I/Os cannot be 0.");
		ShowSettings();
		return;
	} else {
		// Seeing what kind of item is selected.
		switch (theApp.pView->m_pWorkerView->GetSelectedType()) {
		case WORKER:
			worker = theApp.pView->m_pWorkerView->GetSelectedWorker();
			worker->SetQueueDepth(GetDlgItemInt(EQueueDepth));
			break;
		case MANAGER:
			manager = theApp.pView->m_pWorkerView->GetSelectedManager();
			manager->SetQueueDepth(GetDlgItemInt(EQueueDepth), GenericDiskType);
			break;
		case ALL_MANAGERS:
			theApp.manager_list.SetQueueDepth(GetDlgItemInt(EQueueDepth), GenericDiskType);
			break;
		}
	}

	EnableWindow();
}