void CPageDisk::ShowDataPattern() { Manager *manager; Worker *worker; int data_pattern = 1; switch (theApp.pView->m_pWorkerView->GetSelectedType()) { case WORKER: // update controls with worker's data worker = theApp.pView->m_pWorkerView->GetSelectedWorker(); if (IsType(worker->Type(), GenericDiskType)) { data_pattern = worker->GetDataPattern(GenericDiskType); } break; case MANAGER: manager = theApp.pView->m_pWorkerView->GetSelectedManager(); data_pattern = manager->GetDataPattern(GenericDiskType); break; default: data_pattern = theApp.manager_list.GetDataPattern(GenericDiskType); break; } m_CDataPattern.SetCurSel(data_pattern); }
// // Shows the selected item's disk starting sector, size, and queue depth. // void CPageDisk::ShowSettings() { Manager *manager; Worker *worker; DWORDLONG disk_size; DWORDLONG disk_start; int queue_depth; int data_pattern; // Get the values for the disk settings from memory. switch (theApp.pView->m_pWorkerView->GetSelectedType()) { case WORKER: worker = theApp.pView->m_pWorkerView->GetSelectedWorker(); disk_size = worker->GetDiskSize(GenericDiskType); disk_start = worker->GetDiskStart(GenericDiskType); queue_depth = worker->GetQueueDepth(GenericDiskType); data_pattern = worker->GetDataPattern(GenericDiskType); break; case MANAGER: manager = theApp.pView->m_pWorkerView->GetSelectedManager(); disk_size = manager->GetDiskSize(GenericDiskType); disk_start = manager->GetDiskStart(GenericDiskType); queue_depth = manager->GetQueueDepth(GenericDiskType); data_pattern = manager->GetDataPattern(GenericDiskType); break; default: disk_size = theApp.manager_list.GetDiskSize(GenericDiskType); disk_start = theApp.manager_list.GetDiskStart(GenericDiskType); queue_depth = theApp.manager_list.GetQueueDepth(GenericDiskType); data_pattern = theApp.manager_list.GetDataPattern(GenericDiskType); } // If there is a displayable value, display it. Otherwise, hide the content // of the edit box. if (disk_size == AMBIGUOUS_VALUE) { m_EDiskSize.SetPasswordChar(32); m_EDiskSize.Invalidate(); } else { m_EDiskSize.SetPasswordChar(0); SetDlgItemInt64(EDiskSize, disk_size, false); } if (disk_start == AMBIGUOUS_VALUE) { m_EDiskStart.SetPasswordChar(32); m_EDiskStart.Invalidate(); } else { m_EDiskStart.SetPasswordChar(0); SetDlgItemInt64(EDiskStart, disk_start, false); } if (queue_depth == AMBIGUOUS_VALUE) { m_EQueueDepth.SetPasswordChar(32); m_EQueueDepth.Invalidate(); } else { m_EQueueDepth.SetPasswordChar(0); SetDlgItemInt(EQueueDepth, queue_depth); } if (data_pattern == AMBIGUOUS_VALUE) { m_CDataPattern.SetCurSel(-1); } else { m_CDataPattern.SetCurSel(data_pattern); } }