void Fixture::setAddress(t_channel address) { /* The address part is stored in the lowest 9 bits */ m_address = (m_address & 0xFE00) | (address & 0x01FF); if (m_console != NULL) { slotConsoleClosed(); viewConsole(); } emit changed(m_id); }
void Fixture::setUniverse(t_channel universe) { /* The universe part is stored in the highest 7 bits */ m_address = (m_address & 0x01FF) | (universe << 9); if (m_console != NULL) { slotConsoleClosed(); viewConsole(); } emit changed(m_id); }
/** * Set the device's universe * * @param universe The DMX universe number (0-127) */ void Device::setUniverse(t_channel universe) { /* The universe part is stored in the highest 7 bits */ m_address = (m_address & 0x01FF) | (universe << 9); if (m_console) { slotConsoleClosed(); viewConsole(); } if (m_monitor) { slotMonitorClosed(); viewMonitor(); } _app->doc()->setModified(true); }
/** * Set the device address * * @param address The DMX address (0-511) */ void Device::setAddress(t_channel address) { /* The address part is stored in the lowest 9 bits */ m_address = (m_address & 0xFE00) | (address & 0x01FF); if (m_console) { slotConsoleClosed(); viewConsole(); } if (m_monitor) { slotMonitorClosed(); viewMonitor(); } _app->doc()->setModified(true); }
/** GUI setup */ spqrMainWindow::spqrMainWindow(int argc, char *argv[], QWidget *parent) : QMainWindow(parent), MruHelper("spqr") { statusBar()->showMessage(tr("spqr Setup")); lqPreferences p; p.loadGeometry(this); con = new ConsoleEdit(argc, argv); connect(con, SIGNAL(engine_ready()), this, SLOT(engineReady())); make_tabs(); QMenu *m = menuBar()->addMenu(tr("&File")); m->setStatusTip(tr("Show File operations")); m->addAction(tr("&New..."), this, SLOT(newFile()), QKeySequence::New)->setStatusTip(tr("Create a new file")); m->addAction(tr("&Open..."), this, SLOT(openFile()), QKeySequence::Open)->setStatusTip(tr("Open an existing file")); m->addMenu(mruMenu = new QMenu(tr("Recent &Files...")))->setStatusTip(tr("List recently opened files")); loadMru(p, this); m->addSeparator(); m->addAction(tr("&Save"), this, SLOT(saveFile()), QKeySequence::Save)->setStatusTip(tr("Save the document to disk")); m->addAction(tr("Save &As..."), this, SLOT(saveFileAs()), QKeySequence::SaveAs)->setStatusTip(tr("Save the document under a new name")); m->addSeparator(); m->addAction(tr("&Quit"), qApp, SLOT(quit()), QKeySequence::Quit)->setStatusTip(tr("Exit the application")); // detach the background processor to avoid a random GPF exiting the program connect(qApp, &QApplication::aboutToQuit, []() { SwiPrologEngine::quit_request(); }); menuBar()->addSeparator(); menuBar()->addAction("&Exec", this, SLOT(execSource()))->setStatusTip(tr("Run Prolog Source code")); menuBar()->addAction("&Source", this, SLOT(viewSource()))->setStatusTip(tr("Show the Prolog source window")); menuBar()->addAction("&Console", this, SLOT(viewConsole()))->setStatusTip(tr("Show the SWI-Prolog console")); menuBar()->addAction("&Help", this, SLOT(viewHelp()))->setStatusTip(tr("Show SWI-Prolog helpDoc")); lastDir = p.value("lastDir").toString(); QString currFile = p.value("fileSource").toString(); if (argc >= 2) currFile = argv[1]; if (currFile.length()) openSourceFile(currFile); }