Work in progress.

merge-requests/3/merge
Teuniz 2019-08-01 15:11:58 +02:00
rodzic 17e6d0c4d7
commit dd24ea8321
5 zmienionych plików z 42 dodań i 16 usunięć

Wyświetl plik

@ -282,6 +282,8 @@ struct device_settings
int show_fps;
int font_size;
// below here is use for the wave inspector
int wave_mem_view_sample_start;
int wave_mem_view_enabled;

Wyświetl plik

@ -65,6 +65,8 @@
#include <QProgressDialog>
#include <QKeySequence>
#include <QEventLoop>
#include <QRect>
#include <QPixmap>
#include <stdio.h>
#include <stdlib.h>
@ -122,8 +124,7 @@ public:
QLabel *statusLabel;
QFont *appfont,
*monofont;
QFont *appfont;
int adjDialFunc,
navDialFunc;

Wyświetl plik

@ -32,23 +32,37 @@
UI_Mainwindow::UI_Mainwindow()
{
int i;
int i, pxw;
char str[1024];
QPixmap pxm(500, 100);
QPainter p_aint(&pxm);
setMinimumSize(1170, 630);
setWindowTitle(PROGRAM_NAME " " PROGRAM_VERSION);
setWindowIcon(QIcon(":/images/r_dsremote.png"));
appfont = new QFont;
monofont = new QFont;
appfont->setFamily("Noto Sans");
appfont->setFamily("Arial");
appfont->setPixelSize(12);
for(i=20; i>7; i--)
{
appfont->setPixelSize(i);
monofont->setFamily("andale mono");
monofont->setPixelSize(12);
p_aint.setFont(*appfont);
pxw = p_aint.boundingRect(0, 0, 500, 100, Qt::AlignLeft | Qt::TextSingleLine, "ABCDEFGHIJKLMNOPQRSTUVWXYZ").width();
// printf("i is: %i width is: %i\n", i, pxw);
if(pxw < 203) break;
}
pxw = i;
appfont->setPixelSize(pxw);
QApplication::setFont(*appfont);
@ -62,6 +76,8 @@ UI_Mainwindow::UI_Mainwindow()
memset(&devparms, 0, sizeof(struct device_settings));
devparms.font_size = pxw;
devparms.screenshot_buf = (char *)malloc(WAVFRM_MAX_BUFSZ);
for(i=0; i<MAX_CHNS; i++)
@ -252,25 +268,25 @@ UI_Mainwindow::UI_Mainwindow()
recordButton->setStyleSheet("background-image: url(:/images/record.png);");
menuGrpBox = new QGroupBox("Menu", DPRwidget);
menuGrpBox->setGeometry(180, 60, 125, 120);
menuGrpBox->setGeometry(180, 50, 125, 130);
acqButton = new QPushButton(menuGrpBox);
acqButton->setGeometry(15, 20, 40, 18);
acqButton->setGeometry(15, 30, 40, 18);
acqButton->setText("acq");
cursButton = new QPushButton(menuGrpBox);
cursButton->setGeometry(70, 20, 40, 18);
cursButton->setGeometry(70, 30, 40, 18);
cursButton->setText("curs");
saveButton = new QPushButton(menuGrpBox);
saveButton->setGeometry(15, 55, 40, 18);
saveButton->setGeometry(15, 65, 40, 18);
saveButton->setText("save");
dispButton = new QPushButton(menuGrpBox);
dispButton->setGeometry(70, 55, 40, 18);
dispButton->setGeometry(70, 65, 40, 18);
dispButton->setText("disp");
utilButton = new QPushButton(menuGrpBox);
utilButton->setGeometry(15, 90, 40, 18);
utilButton->setGeometry(15, 100, 40, 18);
utilButton->setText("util");
helpButton = new QPushButton(menuGrpBox);
helpButton->setGeometry(70, 90, 40, 18);
helpButton->setGeometry(70, 100, 40, 18);
helpButton->setText("help");
horizontalGrpBox = new QGroupBox("Horizontal", DPRwidget);
@ -636,7 +652,6 @@ UI_Mainwindow::~UI_Mainwindow()
delete scrn_thread;
delete appfont;
delete monofont;
pthread_mutex_destroy(&devparms.mutexx);
free(devparms.screenshot_buf);

Wyświetl plik

@ -146,6 +146,10 @@ void SignalCurve::paintEvent(QPaintEvent *)
paint.setRenderHint(QPainter::Qt4CompatiblePainting, true);
#endif
smallfont.setPixelSize(devparms->font_size);
paint.setFont(smallfont);
drawWidget(&paint, width(), height());
old_w = width();

Wyświetl plik

@ -97,6 +97,10 @@ void WaveCurve::paintEvent(QPaintEvent *)
QPainter *painter = &paint;
smallfont.setPixelSize(devparms->font_size);
painter->setFont(smallfont);
curve_w = width();
curve_h = height();