void Integrator::reportProgress() { if (!reporting) { openReport(); reporting = true; } updateReport(); }
void FLReportViewer::saveSimpleSVGStyle() { QString backStyleName = styleName_; styleName_ = "_simple"; //styleName_ = "_mark"; saveSVGStyle(); styleName_ = backStyleName; updateReport(); }
void FLReportViewer::loadSVGStyle() { QString fileName = QFileDialog::getOpenFileName("", tr("Fichero SVG (*.svg)"), this, tr("Cargar estilo SVG"), tr("Cargar estilo SVG")); if (fileName.isEmpty()) return; ledStyle->setText("file:" + fileName); updateReport(); }
void FLReportViewer::saveSVGStyle() { if (report) { QString fileName = QFileDialog::getSaveFileName("", tr("Fichero SVG (*.svg)"), this, tr("Guardar en SVG"), tr("Guardar en SVG")); if (fileName.isEmpty()) return; if (!fileName.upper().contains(".SVG")) fileName += ".svg"; if (QFile::exists(fileName) && QMessageBox::question(this, tr("Sobreescribir %1").arg(fileName), tr("Ya existe un fichero llamado %1. ¿ Desea sobreescribirlo ?").arg(fileName), tr("&Sí"), tr("&No"), QString::null, 0, 1)) return; FLStylePainter::setSVGMode(true); updateReport(); FLStylePainter::setSVGMode(false); QStringList fileNames; QString fname; QPicture *page; QSize psize; for (int i = 0; i < report->pageCount(); ++i) { fname = fileName + QString::number(i); fileNames.append(fname); page = report->getPageAt(i); psize = report->pageDimensions(); page->setBoundingRect(QRect(QPoint(0, 0), psize)); page->save(fname, "svg"); } FLStylePainter::normalizeSVGFile(fileName, fileNames); updateReport(); } }
int main() { // TODO: watchdog wdt_disable(); // no watchdog, just because I'm lazy //position = 0; TCCR1B = _BV(CS12) | _BV(CS11); // timer is initialized, used to keep track of idle period hardwareInit(); usbInit(); // start v-usb usbDeviceDisconnect(); // enforce USB re-enumeration, do this while interrupts are disabled! _delay_ms(250); usbDeviceConnect(); sei(); // enable interrupts uint8_t to_send = 1; // boolean, true for first time while (1) { usbPoll(); /* * this area is where you should set the movement * and button values of the reports using the input * method of your choice * */ updateReport(); // determine whether or not the report should be sent if ((TCNT1 > ((4 * (F_CPU / 1024000)) * idle_rate) || TCNT1 > 0x7FFF) && idle_rate != 0) {// using idle rate to_send = 1; } else {// or if data has changed if (memcmp(&gamepad_report, &gamepad_report_old, sizeof(gamepad_report_t)) != 0) { to_send = 1; } } usbPoll(); if (to_send != 0) { // send the data if needed usbSendHidReport((uchar*)&gamepad_report, sizeof(gamepad_report_t)); TCNT1 = 0; // reset timer } usbPoll(); memcpy(&gamepad_report_old, &gamepad_report, sizeof(gamepad_report_t)); to_send = 0; // reset flag } return 0; }