📄 module.h
字号:
/*******************************************************************************//* Project: SOFTWARE RADIO - LCM Laboratoire de Communications Mobiles *//* -------------------------------------------------------------------------- *//* Filename: module.h *//* Description: Class implementing a module -- a subsystem of the software *//* radio system. *//* -------------------------------------------------------------------------- *//* Date: January 09 2003 *//* Version: v1.0 *//* Author: Braure Jerome, Ferreiro Jose *//* Communication Systems (9th semester) - EPFL *//* Changelog: ineiti - 04/03/01 - Added canvasFont*//*******************************************************************************//*******************************************************************************//* 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. *//*******************************************************************************/#ifndef MODULE_H#define MODULE_H#include <qvaluevector.h>#include <qstring.h>#include <qcanvas.h>#include <qrect.h>#include <qobject.h>#include "iolink.h"#include "port.h"#include "stats.h"#include "config.h"#include "defines.h"#include "fifocmd.h"#define MAX_STATS_DISPLAY 2class Show;class ConfWind;class Image;class Module : public QObject { Q_OBJECT; public: enum blockType_e { block_port, block_stats }; Module(FifoCmd *c, QCanvas *ca, int i, bool t = false ); ~Module(); void setX(int x); void setY(int y); void setNumberIn(int numberOfPorts, int numberOfPortsUsed); void setNumberOut(int numberOfPorts, int numberOfPortsUsed); int getMaxX() { return (x + width); }; int getInputXPosition(int inputNumber); int getInputYPosition(); int getOutputXPosition(int outputNumber); int getOutputYPosition(); bool reset(); void show(); void hide(); void addInputLink(IOLink* link); void addOutputLink(IOLink* link); void addStats(Stats* stats); void addConfig(Config* config); void addPort(Port* port); void setText( QString variableName ); void setThin( bool t ){ isThin = t; } int getId(){ return id; } FifoCmd* getRadio(){ return radio; } void plotData( int id, enum blockType_e bt ); void showConfig(); // module position & size int x, y, width, height; // TRUE when the module IS displayed on the canvas bool visible; // number of the zone to which the module (graphically) belongs int zone; // name of the module (shown on canvas) QString name; // number of inputs int numberIn; // number of inputs that are used int numberInUsed; // number of outputs int numberOut; // number of outputs that are used int numberOutUsed; // number of the above-neighbor module (= -1 if no neighbor) int upperNeighbor; // number of the under-neighbor module (= -1 if no neighbor) int lowerNeighbor; // offset used for drawing horiz. part of link at different coord. int outLinkSpace; // same as above, but for input links int inLinkSpace; // length between two legs int legInterval; // greatest port number used int greatestPortUsed; // vector containing input links QValueVector<IOLink> inputLinkVect; // vector containing output links QValueVector<IOLink> outputLinkVect; // list of Port QPtrList<Port> portList; // list of Stats QPtrList<Stats> statsList; // list of Config QPtrList<Config> configList; // The font to use QFont canvasFont; protected: QString updateFont( QString s ); // pointer to the radio-command interface FifoCmd *radio; // area on which the modules are drawn QCanvas* canvas; // module number int id; // Is it a thin module? Like stfa and stuff bool isThin; // The stats to be displayed Stats *displayStats[ MAX_STATS_DISPLAY ]; // The last profiling values QPair<long long int, long long int> profValues[2]; // This module might show some graphics Show *graphic; // An eventual config-window ConfWind *configWin; // An image to be shown Image *image; public slots: // Starts some data processing void processData(); private: // text displayed on the module QCanvasText *canvasText; // rectangle containing the size & position info QCanvasRectangle *canvasRectangle; // The input-connections QPtrList<QCanvasRectangle> inputFeet; // The output-connections QPtrList<QCanvasRectangle> outputFeet;};#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -