void RAIDProcess::initialize() { RAIDProcessState *myState = (RAIDProcessState*) getState(); int processNumber = getObjectID()->getSimulationObjectID(); IntVTime sendTime = dynamic_cast<const IntVTime&> (getSimulationTime()); delete (myState->getGen()); MLCG *gen = new MLCG(seed, seed + 1); myState->setGen(gen); outputHandle = getObjectHandle(outputName); newConfiguration(); RAIDRequest* newRequest = new RAIDRequest(sendTime, sendTime + 1, this, this); newRequest->setSourceObject(getName()); newRequest->setSinkObject(""); newRequest->setStartCylinder(-1); newRequest->setStartStripe(-1); newRequest->setStartSector(-1); newRequest->setSizeRead(1); newRequest->setLogicalSector(-1); newRequest->setRead(true); newRequest->setParityMsg(false); newRequest->setBeginningOfStrype(-1); myState->setBeginningOfStrype(newRequest->getBeginningOfStrype()); myState->setStopProcessing(false); this->receiveEvent(newRequest); }
/*! \param pDebuggerMainWindow - pointer to DebuggerMainWindow */ DebuggerConfigurationsDialog::DebuggerConfigurationsDialog(DebuggerMainWindow *pDebuggerMainWindow) : QDialog(pDebuggerMainWindow, Qt::WindowTitleHint) { setWindowTitle(QString(Helper::applicationName).append(" - ").append(Helper::debugConfigurations)); setAttribute(Qt::WA_DeleteOnClose); mpDebuggerMainWindow = pDebuggerMainWindow; // create tool buttons mpNewToolButton = new QToolButton; mpNewToolButton->setIcon( QIcon(":/Resources/icons/new.svg")); mpNewToolButton->setIconSize(Helper::buttonIconSize); mpNewToolButton->setToolTip(tr("New Configuration")); mpNewToolButton->setAutoRaise(true); connect(mpNewToolButton, SIGNAL(clicked()), SLOT(newConfiguration())); mpDeleteToolButton = new QToolButton; mpDeleteToolButton->setIcon( QIcon(":/Resources/icons/delete.svg")); mpDeleteToolButton->setIconSize(Helper::buttonIconSize); mpDeleteToolButton->setToolTip(tr("Delete Configuration")); mpDeleteToolButton->setAutoRaise(true); connect(mpDeleteToolButton, SIGNAL(clicked()), SLOT(removeConfiguration())); // create status bar mpStatusBar = new QStatusBar; mpStatusBar->setObjectName("ModelStatusBar"); mpStatusBar->setSizeGripEnabled(false); mpStatusBar->addPermanentWidget(mpNewToolButton, 0); mpStatusBar->addPermanentWidget(mpDeleteToolButton, 0); mpStatusBar->addPermanentWidget(new QLabel, 1); // configurations list mpConfigurationsListWidget = new QListWidget; mpConfigurationsListWidget->setItemDelegate(new ItemDelegate(mpConfigurationsListWidget)); mpConfigurationsListWidget->setTextElideMode(Qt::ElideMiddle); connect(mpConfigurationsListWidget, SIGNAL(currentItemChanged(QListWidgetItem*,QListWidgetItem*)), SLOT(changeConfigurationPage(QListWidgetItem*,QListWidgetItem*))); // configuration pages mpConfigurationPagesWidget = new QStackedWidget; /* Configuration settings Page Splitter */ mpConfigurationsSplitter = new QSplitter; mpConfigurationsSplitter->setVisible(false); mpConfigurationsSplitter->setChildrenCollapsible(false); mpConfigurationsSplitter->setHandleWidth(4); mpConfigurationsSplitter->setContentsMargins(0, 0, 0, 0); mpConfigurationsSplitter->setOrientation(Qt::Horizontal); mpConfigurationsSplitter->addWidget(mpConfigurationsListWidget); mpConfigurationsSplitter->addWidget(mpConfigurationPagesWidget); mpConfigurationsSplitter->setStretchFactor(0, 1); mpConfigurationsSplitter->setStretchFactor(1, 2); // buttons mpSaveButton = new QPushButton(Helper::save); mpSaveButton->setToolTip(tr("Saves all the debug configurations")); connect(mpSaveButton, SIGNAL(clicked()), this, SLOT(saveAllConfigurations())); mpSaveAndDebugButton = new QPushButton(tr("Save && Debug")); mpSaveAndDebugButton->setToolTip(tr("Saves all the debug configurations and starts debugging the active debug configuration")); connect(mpSaveAndDebugButton, SIGNAL(clicked()), this, SLOT(saveAllConfigurationsAndDebugConfiguration())); mpCancelButton = new QPushButton(Helper::cancel); connect(mpCancelButton, SIGNAL(clicked()), SLOT(reject())); // adds debugger buttons to the button box mpConfigurationsButtonBox = new QDialogButtonBox(Qt::Horizontal); mpConfigurationsButtonBox->setVisible(false); mpConfigurationsButtonBox->addButton(mpSaveButton, QDialogButtonBox::ActionRole); mpConfigurationsButtonBox->addButton(mpSaveAndDebugButton, QDialogButtonBox::ActionRole); mpConfigurationsButtonBox->addButton(mpCancelButton, QDialogButtonBox::ActionRole); // set the layout QGridLayout *pMainLayout = new QGridLayout; pMainLayout->setAlignment(Qt::AlignLeft | Qt::AlignTop); pMainLayout->setContentsMargins(0, 0, 0, 2); pMainLayout->addWidget(mpStatusBar, 0, 0); pMainLayout->addWidget(mpConfigurationsSplitter, 1, 0); pMainLayout->addWidget(mpConfigurationsButtonBox, 2, 0, 1, 1, Qt::AlignRight); setLayout(pMainLayout); // read the saved debug configurations readConfigurations(); }