CGMainWindow::CGMainWindow(QWidget *parent, Qt::WindowFlags flags) : QMainWindow(parent, flags) { resize(604, 614); // Create a nice frame to put around the OpenGL widget QFrame *f = new QFrame(this); f->setFrameStyle(QFrame::Sunken | QFrame::Panel); f->setLineWidth(2); // Create our OpenGL widget ogl = new CGView(this, f); QMenu *file = new QMenu("&Plane", this); file->addAction("&Reset plane", this->ogl, SLOT(reset_plane()), Qt::CTRL + Qt::Key_R); file->addAction("&Toggle follow", this->ogl, SLOT(toggle_follow()), Qt::CTRL + Qt::Key_T); file->addAction("Quit", this, SLOT(close()), Qt::CTRL + Qt::Key_Q); menuBar()->addMenu(file); // Put the GL widget inside the frame QHBoxLayout *layout = new QHBoxLayout(); layout->addWidget(ogl); layout->setMargin(0); f->setLayout(layout); setCentralWidget(f); statusBar()->showMessage("Ready", 1000); }
void reset_chip(struct nand_chip *p_chip) { int i; p_chip->status = 0; p_chip->current_access_mode = MLC_MODE; p_chip->cmd = IDLE; for (i = 0; i < PLANES_PER_CHIP; i++) { reset_plane(&p_chip->planes[i]); } }