CCvProject::CCvProject(CSerialThread* serialThread, QWidget* parent) :
    CGenericProject(serialThread, parent)
{
    Q_ASSERT(serialThread);
    //Q_ASSERT(parent);

    initPlot();
    initFields();

    mp_serialThread = serialThread;
    updateTree();

    // testing
    /*quint16 t;
    union32_t x;
    union32_t y;
    t = 0;
    x.idFl = 0.5;
    y.idFl = 0.001;
    on_received_giveMeasChunkCv(t, x, y);

    t = 1;
    x.idFl = 1;
    y.idFl = 0.005;
    on_received_giveMeasChunkCv(t, x, y);

    t = 2;
    x.idFl = 0.7;
    y.idFl = 0.003;
    on_received_giveMeasChunkCv(t, x, y);

    insertLabels();*/
}
Exemple #2
0
MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    ping = new QProcess();
    iperf = new QProcess();
    timer = new QTimer();
    timer->setSingleShot(true);

    numTests = 0;

    ui->udpBandwidthField->hide();

    connect(ping,SIGNAL(readyReadStandardOutput()),this,SLOT(readPingOutput()));
    connect(iperf,SIGNAL(readyReadStandardOutput()),this,SLOT(readIperfOutput()));

    connect(ping,SIGNAL(readyReadStandardError()),this,SLOT(readError()));
    connect(iperf,SIGNAL(readyReadStandardError()),this,SLOT(readError()));

    connect(ping,SIGNAL(started()),this,SLOT(processStarted()));
    connect(iperf,SIGNAL(started()),this,SLOT(processStarted()));

    connect(ping,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(pingFinished(int,QProcess::ExitStatus)));
    connect(iperf,SIGNAL(finished(int,QProcess::ExitStatus)),this,SLOT(iperfFinished(int,QProcess::ExitStatus)));

    connect(ping,SIGNAL(error(QProcess::ProcessError)),this,SLOT(error(QProcess::ProcessError)));
    connect(iperf,SIGNAL(error(QProcess::ProcessError)),this,SLOT(error(QProcess::ProcessError)));

    connect(timer,SIGNAL(timeout()),this,SLOT(startPing()));

    initPlot();
}
Exemple #3
0
void ArmSideView::configDraw(std::string name, int w, int h)
{
    // create an image of the specified size
    // able to represent the arm in 3 directions (up, down and right)
    // with isotropic scaling (same scale in all directions)
    setIsotropic(true);
    initPlot(w, h, name);   
    // only positive x ranges
    setRanges(0, maxLen, -maxLen, maxLen);
}
Exemple #4
0
PreviewPlot2D::PreviewPlot2D(QWidget* parent, const char *name, Qt::WidgetAttribute wflags):
        WorkshopTool(parent, name, wflags)
{
	pWin->setCaption(name);
	view_back = new Q3HBox(pWin);
	view_back->setFrameStyle( Q3Frame::StyledPanel | Q3Frame::Sunken );

	initTool();
	initPlot();
	initVars();
	//initActions();
	//initToolBar();
	
	connect(this, SIGNAL(newMeasure(int)), SLOT(onNewMeasure(int)));
	//connect(this, SIGNAL(rmMeasure(int)), SLOT(onDelMeasure(int)));
	pWin->show();
}
Exemple #5
0
/*!
  \brief Constructor
  \param title Title text
  \param parent Parent widget
  \param name Widget name
 */
QwtPlot::QwtPlot(const QString &title, QWidget *p, const char *name) :
    QFrame(p, name, WRepaintNoErase|WResizeNoErase),
    d_grid(this)
{
    initPlot(title);
}
Exemple #6
0
QwtPlot::QwtPlot(QWidget *p, const char *name) :
    QFrame(p, name, WRepaintNoErase|WResizeNoErase),
    d_grid(this)
{
    initPlot();
}
Exemple #7
0
/*!
  Constructor
  \param parent Parent widget
 */
QwtPolarPlot::QwtPolarPlot( QWidget *parent ):
    QFrame( parent )
{
  initPlot( QwtText() );
}
Exemple #8
0
/*!
  Constructor
  \param title Title text
  \param parent Parent widget
 */
QwtPolarPlot::QwtPolarPlot( const QwtText &title, QWidget *parent ):
    QFrame( parent )
{
  initPlot( title );
}
Exemple #9
0
/*!
  \brief Constructor
  \param title Title text
  \param parent Parent widget
  \param name Widget name
 */
QwtPlot::QwtPlot(const QString &title, QWidget *parent, const char *name) :
    QFrame(parent, name, Qt::WRepaintNoErase|Qt::WResizeNoErase)
{
    initPlot(title);
}
Exemple #10
0
QwtPlot::QwtPlot(QWidget *parent, const char *name) :
    QFrame(parent, name, Qt::WRepaintNoErase|Qt::WResizeNoErase)
{
    initPlot();
}
Exemple #11
0
int cellButtonProc(PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo)
{
	PtArg_t args[1];
	PtWidget_t *thisModule;
	PtWidget_t *cellButton;
	RASTER *rasters;
	PAGE *thisPage;
	CELL *thisCell, *lastCell;
	PLOT *thisPlot, *lastPlot;
	int cellButtonName;
	void *userData;
	int RCindex;
	int i, reFlag, reDefIndex;

	/* eliminate 'unreferenced' warnings */
	widget = widget, apinfo = apinfo, cbinfo = cbinfo;

	reDefIndex = 0;
	
	/* get a pointer to the rasters structure */
	rasters = getRasters();

	/* get pointer to the window module that contains this widget */
	thisModule = ApGetInstance(widget);

	/* figure out this raster page */
	thisPage = getRasterPage(rasters->curPageIndx);

	/* get this button's position argument */
	PtSetArg(&args[0], Pt_ARG_USER_DATA, &userData, 0);
	PtGetResources(widget, 1, args);
	sscanf(userData, "%d", &RCindex);

	/* mark the selected button yellow */
	/* first set the fill color of all buttons to grey */
	PtSetArg(&args[0], Pt_ARG_FILL_COLOR, Pg_GREY, 0);
	for(i = 0; i < 64; i++) {
		cellButtonName = getCellButtonName(i);
		cellButton = ApGetWidgetPtr(thisModule, cellButtonName);
		if(!cellButton) continue; /* skip bad widgets */
		PtSetResources(cellButton, 1, args);
	}

	/* now set this button's fill color to yellow */
	PtSetArg(&args[0], Pt_ARG_FILL_COLOR, Pg_YELLOW, 0);
	PtSetResources(widget, 1, args);

	/* first find out if the user is defining a new cell
	 * or redefining an old cell
	 * to do this, compare the position index of each
	 * previously defined cell with that of the selected cell
	 */
	reFlag = 0;
	for(i = 0; i < thisPage->nDefCells; i++) {
		thisCell = getRasterCell(thisPage->cellsInfo, i);
		if(thisCell->RCindex == RCindex) {	/* true if redefining an old cell */
			reFlag++;			/* make the redefine flag non-zero */
			reDefIndex = i;			/* index of cell to be redefined */
			break;				/* quit testing if a previous index matches the selected cell index */
		}
	}

	/* if the redefine flag is not 0, the user is redefining an old cell */
	if(reFlag) {
		thisPage->curCellIndx = reDefIndex;
		thisCell = getRasterCell(thisPage->cellsInfo, thisPage->curCellIndx);
		thisPlot = &thisCell->plotInfo;
	}

	/* otherwise, the user is defining a new cell*/
	if(!reFlag) {
		thisPage->curCellIndx = thisPage->nDefCells;
		thisCell = getRasterCell(thisPage->cellsInfo, thisPage->curCellIndx);
		thisPlot = &thisCell->plotInfo;

		/* set the relative location of this cell on the page */
		thisCell->RCindex = RCindex;
		thisCell->colN = RCindex % 8;
		thisCell->rowN = (thisPage->nRows - 1) - (RCindex / 8);

		/* if this is not the first cell on the page
		 * initialize it with the values of the last cell
		 */
		if(thisPage->curCellIndx) {
			lastCell = getRasterCell(thisPage->cellsInfo, thisPage->curCellIndx - 1);
			lastPlot = &lastCell->plotInfo;
			initPlot(thisPage, thisPlot, lastPlot);
		}
		thisPage->nDefCells++;			/* increment the number of defined cells on this page */
	}

	/* set the button's label */
	setButtonLabel(thisModule, thisCell);

 	initPlotWidgets(thisModule, thisPlot);
 	initGraphWidgets(thisModule, &thisPlot->graph);

	return( Pt_CONTINUE );
}