#include "subwindow_uwi.h"
#include "ui_subwindow_uwi.h"
#include <qwt_scale_draw.h>
#include "dmg_eva.h"
#include <QMessageBox>
#include "plot_frm.h"
{
public:
MyScaleDraw1()
{
setLabelRotation( 0 );
setLabelAlignment( Qt::AlignLeft | Qt::AlignVCenter );
setSpacing( 10 );
}
virtual QwtText label
( double value
) const {
QwtText h
=QwtText(QString::number((value
*info_Inspection.
scanInterval.
toFloat())-(info_Inspection.
Width.
toInt()/2)));
return h;
}
};
{
public:
MyScaleDraw2()
{
setLabelRotation( 0 );
setLabelAlignment( Qt::AlignLeft | Qt::AlignVCenter );
setSpacing( 10 );
}
virtual QwtText label
( double value
) const {
return h;
}
};
subwindow_uwi
::subwindow_uwi(QWidget *parent
) : ui(new Ui::subwindow_uwi)
{
ui->setupUi(this);
}
subwindow_uwi::~subwindow_uwi()
{
delete ui;
}
void subwindow_uwi::setframe()
{
d_plot_WavenumberSpectrum = new plot_frm( ui->WavenumberSpectrum );
d_plot_WavenumberSpectrum->setGeometry(20,20,400,320);
d_plot_WavenumberSpectrum->updateGeometry();
d_plot_WavenumberSpectrum->updateAxes();
d_plot_WavenumberSpectrum->setcolorbarmax(9);
d_plot_WavenumberSpectrum
->setAxisScaleDraw
( QwtPlot::xBottom,
new MyScaleDraw1
() );
d_plot_WavenumberSpectrum
->setAxisScaleDraw
( QwtPlot::yLeft,
new MyScaleDraw2
() );
}
void subwindow_uwi::on_PB_delete()
{
delete d_plot_WavenumberSpectrum;
}
void subwindow_uwi::on_PB_WavenumberSpectrum_clicked()
{
if(run_wavenumber_vs_frequency_read() != SIPIF_ERR_OK )
{ msgb.setText("Cannot read"); msgb.exec();
}
setframe();
}
#include "subwindow_uwi.h"
#include "ui_subwindow_uwi.h"
#include <qwt_scale_draw.h>
#include "dmg_eva.h"
#include <QMessageBox>
#include "plot_frm.h"
class MyScaleDraw1: public QwtScaleDraw
{
public:
MyScaleDraw1()
{
setTickLength( QwtScaleDiv::MajorTick, 10 );
setTickLength( QwtScaleDiv::MinorTick, 2 );
setTickLength( QwtScaleDiv::MediumTick, 0 );
setLabelRotation( 0 );
setLabelAlignment( Qt::AlignLeft | Qt::AlignVCenter );
setSpacing( 10 );
}
virtual QwtText label( double value ) const
{
QwtText h=QwtText(QString::number((value*info_Inspection.scanInterval.toFloat())-(info_Inspection.Width.toInt()/2)));
return h;
}
};
class MyScaleDraw2: public QwtScaleDraw
{
public:
MyScaleDraw2()
{
setTickLength( QwtScaleDiv::MajorTick, 2 );
setTickLength( QwtScaleDiv::MinorTick, 0 );
setTickLength( QwtScaleDiv::MediumTick, 0 );
setLabelRotation( 0 );
setLabelAlignment( Qt::AlignLeft | Qt::AlignVCenter );
setSpacing( 10 );
}
virtual QwtText label( double value ) const
{
QwtText h=QwtText(QString::number((value*25/(info_FPGA.s_points/2))-12.5,'f',1));
return h;
}
};
subwindow_uwi::subwindow_uwi(QWidget *parent) :
QDialog(parent),
ui(new Ui::subwindow_uwi)
{
ui->setupUi(this);
}
subwindow_uwi::~subwindow_uwi()
{
delete ui;
}
void subwindow_uwi::setframe()
{
d_plot_WavenumberSpectrum = new plot_frm( ui->WavenumberSpectrum );
d_plot_WavenumberSpectrum->setGeometry(20,20,400,320);
d_plot_WavenumberSpectrum->updateGeometry();
d_plot_WavenumberSpectrum->updateAxes();
d_plot_WavenumberSpectrum->setcolorbarmax(9);
d_plot_WavenumberSpectrum->setAxisScaleDraw( QwtPlot::xBottom, new MyScaleDraw1() );
d_plot_WavenumberSpectrum->setAxisScaleDraw( QwtPlot::yLeft, new MyScaleDraw2() );
}
void subwindow_uwi::on_PB_delete()
{
delete d_plot_WavenumberSpectrum;
}
void subwindow_uwi::on_PB_WavenumberSpectrum_clicked()
{
QMessageBox msgb;
if(run_wavenumber_vs_frequency_read() != SIPIF_ERR_OK )
{ msgb.setText("Cannot read"); msgb.exec();
}
setframe();
}
To copy to clipboard, switch view to plain text mode
Bookmarks