⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 radioview.cpp

📁 This a framework to test new ideas in transmission technology. Actual development is a LDPC-coder in
💻 CPP
字号:
/*******************************************************************************//*  Project:        SOFTWARE RADIO - LCM Laboratoire de Communications Mobiles *//*  -------------------------------------------------------------------------- *//*  Filename:       radioview.cpp                                              *//*  Description:    Subclass of QWidget. It implements a page view (in a tab)  *//*                  of the Software Radio GUI.                                 *//*  -------------------------------------------------------------------------- *//*  Date:           April 7 2003                                               *//*  Version:        v1.0                                                       *//*  Authors:        Porchet Vincent                                            *//*                  Computer Science (6th semester) - EPFL                     *//*******************************************************************************//*******************************************************************************//*  This program is free software; you can redistribute it and/or modify it    *//*  under the terms of the GNU General Public License as published by the Free *//*  Software Foundation; either version 2 of the License, or (at your option)  *//*  any later version.                                                         *//*******************************************************************************/#include <iostream>#include <qobject.h> // for connect#include <qapplication.h> //for desktop, appel a qApp pointeur sur la QApplication.#include <qpopupmenu.h> // for fileMenu, helpMenu#include <qmenubar.h>  // for menuBar#include <qlayout.h> // for QHBoxLayout#include "radioview.h"#include "defines.h"#include "canvasview.h"#include "global.h"/*******************************************************************************//* Function:    RadioView() - (constuctor)                                     *//* Description: Constructs an instance of class Radioview, which inherits      *//*              from class QWidget.                                            *//* Inputs:      sdbpath: QString that give the path of the SDB directory       *//*              parent: the parent widget.                                     *//*******************************************************************************/RadioView::RadioView( FifoCmd *c, QWidget *parent ) :   QWidget( parent ), radio( c ) {  QDesktopWidget * d = QApplication::desktop();  desktopWidth = d->width() / 2;      // returns desktop width  desktopHeight = d->height();    // returns desktop height  mapper = new Mapper();  canvas = new QCanvas( this );  canvas->setBackgroundColor( BACKGROUND );  canvas->resize( CANVAS_WIDTH, CANVAS_HEIGHT );  canvasView = new CanvasView( canvas, this, mapper );  canvasView->setCanvas( canvas ); // - ( desktopWidth / 2 )  canvasView->center( ( CANVAS_WIDTH / 2 ),                      ( CANVAS_HEIGHT / 2 ) - ( desktopHeight / 2 ) );  connect( canvasView, SIGNAL( moduleSelected( Module* ) ),           this, SLOT( slotModuleSelected( Module* ) ) );  QHBoxLayout *box = new QHBoxLayout( this, 0, -1, "radioViewLayout" );  box->addWidget( canvasView );  mg = new ModuleGenerator( c, mapper, canvas );  timer = new QTimer();  QObject::connect( timer, SIGNAL( timeout() ),                    SLOT( update() ) );  timer->start( GUI_UPDATE_TIMER );}void RadioView::slotChangedTab( QWidget* w ) {  if ( w );  if ( isVisible() ){    timer->start( GUI_UPDATE_TIMER );    activeRadioView( radio );  } else {    timer->stop();  }}void RadioView::slotModuleSelected ( Module* module ) {  emit moduleSelected ( module );  //   cout<<"emit module in radioView : "<<module->name<<"\n";}void RadioView::update(){  mg->updateModules();  mapper->map( canvas );  canvas->update();}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -