2
0
forked from Ivasoft/DSView

Merge branch 'release-0.93' into develop

This commit is contained in:
DreamSourceLab
2015-05-08 16:22:21 +08:00
11 changed files with 12 additions and 19 deletions

View File

@@ -103,7 +103,7 @@ set(DS_DESCRIPTION "A GUI for instruments of DreamSourceLab")
set(DS_VERSION_MAJOR 0) set(DS_VERSION_MAJOR 0)
set(DS_VERSION_MINOR 9) set(DS_VERSION_MINOR 9)
set(DS_VERSION_MICRO 2) set(DS_VERSION_MICRO 3)
set(DS_VERSION_STRING set(DS_VERSION_STRING
${DS_VERSION_MAJOR}.${DS_VERSION_MINOR}.${DS_VERSION_MICRO} ${DS_VERSION_MAJOR}.${DS_VERSION_MINOR}.${DS_VERSION_MICRO}
) )

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 9.8 KiB

View File

@@ -40,8 +40,6 @@
#include "config.h" #include "config.h"
char decoders_path[256];
void usage() void usage()
{ {
fprintf(stdout, fprintf(stdout,
@@ -122,11 +120,6 @@ int main(int argc, char *argv[])
do { do {
#ifdef ENABLE_DECODE #ifdef ENABLE_DECODE
QDir dir(QCoreApplication::applicationDirPath());
assert(dir.cd("decoders"));
std::string str = dir.absolutePath().toStdString() + "/";
strcpy(decoders_path, str.c_str());
// Initialise libsigrokdecode // Initialise libsigrokdecode
if (srd_init(NULL) != SRD_OK) { if (srd_init(NULL) != SRD_OK) {
qDebug() << "ERROR: libsigrokdecode init failed."; qDebug() << "ERROR: libsigrokdecode init failed.";

View File

@@ -48,8 +48,7 @@ WaitingDialog::WaitingDialog(QWidget *parent, boost::shared_ptr<pv::device::DevI
this->setFixedSize((GIF_SIZE+TIP_WIDTH)*2, (GIF_SIZE+TIP_HEIGHT)*2); this->setFixedSize((GIF_SIZE+TIP_WIDTH)*2, (GIF_SIZE+TIP_HEIGHT)*2);
int midx = this->width() / 2; int midx = this->width() / 2;
int midy = this->height() / 2; int midy = this->height() / 2;
this->setWindowOpacity(0.6); this->setWindowOpacity(0.7);
this->setStyleSheet("background-color: rgb(255, 255, 255);");
this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint); this->setWindowFlags(Qt::Dialog | Qt::FramelessWindowHint);
label = new QLabel(this); label = new QLabel(this);
@@ -60,7 +59,6 @@ WaitingDialog::WaitingDialog(QWidget *parent, boost::shared_ptr<pv::device::DevI
tips = new QLabel(this); tips = new QLabel(this);
tips->setText(TIPS_INFO); tips->setText(TIPS_INFO);
tips->setStyleSheet("color: rgb(17, 133, 209); background-color: transparent;");
QFont font; QFont font;
font.setPointSize(10); font.setPointSize(10);
font.setBold(true); font.setBold(true);
@@ -71,8 +69,6 @@ WaitingDialog::WaitingDialog(QWidget *parent, boost::shared_ptr<pv::device::DevI
timer = new QTimer(); timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(changeText())); connect(timer, SIGNAL(timeout()), this, SLOT(changeText()));
QString styleSheet = "* {color: rgb(255, 255, 255); background-color: rgb(17, 133, 209);} *:hover {background-color: rgb(238, 178, 17);}";
_button_box.setStyleSheet(styleSheet);
_button_box.setGeometry(width()-_button_box.width()-30, height()-_button_box.height()-15, _button_box.setGeometry(width()-_button_box.width()-30, height()-_button_box.height()-15,
_button_box.width(), _button_box.height()); _button_box.width(), _button_box.height());
connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept())); connect(&_button_box, SIGNAL(accepted()), this, SLOT(accept()));

View File

@@ -103,6 +103,7 @@ const QColor DsoSignal::SignalColours[4] = {
}; };
const float DsoSignal::EnvelopeThreshold = 256.0f; const float DsoSignal::EnvelopeThreshold = 256.0f;
const double DsoSignal::TrigMargin = 0.02;
const int DsoSignal::UpMargin = 30; const int DsoSignal::UpMargin = 30;
const int DsoSignal::DownMargin = 30; const int DsoSignal::DownMargin = 30;
@@ -466,13 +467,13 @@ void DsoSignal::set_trig_vpos(int pos)
double delta = min((double)max(pos - UpMargin, 0), get_view_rect().height()) * 1.0 / get_view_rect().height(); double delta = min((double)max(pos - UpMargin, 0), get_view_rect().height()) * 1.0 / get_view_rect().height();
bool isDSCope = (strcmp(_dev_inst->dev_inst()->driver->name, "DSCope") == 0); bool isDSCope = (strcmp(_dev_inst->dev_inst()->driver->name, "DSCope") == 0);
if (isDSCope) { if (isDSCope) {
_trig_vpos = delta; _trig_vpos = min(max(delta, 0+TrigMargin), 1-TrigMargin);
trig_value = delta * 255; trig_value = delta * 255;
} else { } else {
delta = delta - _zeroPos; delta = delta - _zeroPos;
delta = min(delta, 0.5); delta = min(delta, 0.5);
delta = max(delta, -0.5); delta = max(delta, -0.5);
_trig_vpos = _zeroPos + delta; _trig_vpos = min(max(_zeroPos + delta, 0+TrigMargin), 1-TrigMargin);
trig_value = (delta * 255.0f + 0x80); trig_value = (delta * 255.0f + 0x80);
} }
_dev_inst->set_config(_probe, NULL, SR_CONF_TRIGGER_VALUE, _dev_inst->set_config(_probe, NULL, SR_CONF_TRIGGER_VALUE,
@@ -491,7 +492,7 @@ void DsoSignal::set_zeroPos(int pos)
double delta = _trig_vpos - _zeroPos; double delta = _trig_vpos - _zeroPos;
set_trig_vpos(get_trig_vpos() + pos - get_zeroPos()); set_trig_vpos(get_trig_vpos() + pos - get_zeroPos());
_zeroPos = min((double)max(pos - UpMargin, 0), get_view_rect().height()) * 1.0 / get_view_rect().height(); _zeroPos = min((double)max(pos - UpMargin, 0), get_view_rect().height()) * 1.0 / get_view_rect().height();
_trig_vpos = min(max(_zeroPos + delta, 0.0), 1.0); _trig_vpos = min(max(_zeroPos + delta, 0+TrigMargin), 1-TrigMargin);
update_zeroPos(); update_zeroPos();
} }

View File

@@ -43,6 +43,7 @@ class DsoSignal : public Signal
private: private:
static const QColor SignalColours[4]; static const QColor SignalColours[4];
static const float EnvelopeThreshold; static const float EnvelopeThreshold;
static const double TrigMargin;
static const int HitCursorMargin = 3; static const int HitCursorMargin = 3;
static const uint64_t vDialValueCount = 8; static const uint64_t vDialValueCount = 8;

View File

@@ -132,8 +132,9 @@ void Viewport::paintEvent(QPaintEvent *event)
break; break;
case SigSession::Running: case SigSession::Running:
//p.setRenderHint(QPainter::Antialiasing); p.setRenderHint(QPainter::Antialiasing);
paintProgress(p); paintProgress(p);
p.setRenderHint(QPainter::Antialiasing, false);
break; break;
} }
} else { } else {
@@ -352,6 +353,7 @@ void Viewport::mousePressEvent(QMouseEvent *event)
_mouse_down_point = event->pos(); _mouse_down_point = event->pos();
_mouse_down_offset = _view.offset(); _mouse_down_offset = _view.offset();
_measure_shown = false;
if (event->buttons() & Qt::LeftButton) { if (event->buttons() & Qt::LeftButton) {
if (_view.cursors_shown()) { if (_view.cursors_shown()) {
@@ -435,7 +437,7 @@ void Viewport::mouseReleaseEvent(QMouseEvent *event)
if (_zoom_rect_visible) { if (_zoom_rect_visible) {
_zoom_rect_visible = false; _zoom_rect_visible = false;
const double newOffset = _view.offset() + (min(event->pos().x(), _mouse_down_point.x()) + 0.5) * _view.scale(); const double newOffset = _view.offset() + (min(event->pos().x(), _mouse_down_point.x()) + 0.5) * _view.scale();
const double newScale = max(min(_view.scale() * (event->pos().x() - _mouse_down_point.x()) / _view.get_view_width(), const double newScale = max(min(_view.scale() * abs(event->pos().x() - _mouse_down_point.x()) / _view.get_view_width(),
_view.get_maxscale()), _view.get_minscale()); _view.get_maxscale()), _view.get_minscale());
if (newScale != _view.scale()) if (newScale != _view.scale())
_view.set_scale_offset(newScale, newOffset); _view.set_scale_offset(newScale, newOffset);
@@ -475,7 +477,7 @@ void Viewport::wheelEvent(QWheelEvent *event)
if (event->orientation() == Qt::Vertical) { if (event->orientation() == Qt::Vertical) {
// Vertical scrolling is interpreted as zooming in/out // Vertical scrolling is interpreted as zooming in/out
const double offset = (_view.session().get_capture_state() == SigSession::Running) ? 0 : event->x(); const double offset = event->x();
_view.zoom(event->delta() / 80, offset); _view.zoom(event->delta() / 80, offset);
} else if (event->orientation() == Qt::Horizontal) { } else if (event->orientation() == Qt::Horizontal) {
// Horizontal scrolling is interpreted as moving left/right // Horizontal scrolling is interpreted as moving left/right

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.