2
0
forked from Ivasoft/DSView

Fix display issue, add signal height limit

This commit is contained in:
DreamSourceLab
2015-09-28 16:31:19 +08:00
parent 17c20781cc
commit 48ab8049cf
12 changed files with 98 additions and 4 deletions

View File

@@ -40,7 +40,7 @@ Annotation::Annotation(const srd_proto_data *const pdata) :
(const srd_proto_data_annotation*)pdata->data;
assert(pda);
_format = pda->ann_format;
_format = pda->ann_class;
const char *const *annotations = (char**)pda->ann_text;
while(*annotations) {

View File

@@ -48,7 +48,7 @@ Search::Search(QWidget *parent, struct sr_dev_inst *sdi, QString pattern) :
search_lineEdit.setInputMask("X X X X X X X X X X X X X X X X");
search_lineEdit.setFont(font);
QLabel *search_label = new QLabel("1 1 1 1 1\n5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0");
QLabel *search_label = new QLabel("1 1 1 1 1 1\n5 4 3 2 1 0 9 8 7 6 5 4 3 2 1 0");
search_label->setFont(font);
search_buttonBox.addButton(QDialogButtonBox::Ok);

View File

@@ -284,6 +284,7 @@ void MainWindow::update_device_list()
{
assert(_sampling_bar);
_session.stop_capture();
_view->show_trig_cursor(false);
_trigger_widget->device_change();
#ifdef ENABLE_DECODE

View File

@@ -82,6 +82,8 @@ DeviceOptions::DeviceOptions(struct sr_dev_inst *sdi) :
case SR_CONF_BUFFERSIZE:
case SR_CONF_TRIGGER_SOURCE:
case SR_CONF_FILTER:
case SR_CONF_MAX_HEIGHT:
case SR_CONF_MAX_HEIGHT_VALUE:
case SR_CONF_COUPLING:
case SR_CONF_EN_CH:
case SR_CONF_OPERATION_MODE:

View File

@@ -122,10 +122,10 @@ void DevMode::on_mode_change()
i != _mode_button_list.end(); i++) {
if ((*i).first.get() == button) {
if (dev_inst->dev_inst()->mode != (*i).second->mode) {
_view.session().stop_capture();
dev_inst->set_config(NULL, NULL,
SR_CONF_DEVICE_MODE,
g_variant_new_int16((*i).second->mode));
mode_changed();
}
}

View File

@@ -57,6 +57,7 @@ const int View::LabelMarginWidth = 70;
const int View::RulerHeight = 50;
const int View::MaxScrollValue = INT_MAX / 2;
const int View::MaxHeightUnit = 20;
//const int View::SignalHeight = 30;s
const int View::SignalMargin = 10;
@@ -470,6 +471,7 @@ void View::update_scale()
void View::signals_changed()
{
int total_rows = 0;
uint8_t max_height = MaxHeightUnit;
const vector< boost::shared_ptr<Trace> > traces(get_traces());
BOOST_FOREACH(const boost::shared_ptr<Trace> t, traces)
{
@@ -483,7 +485,16 @@ void View::signals_changed()
- horizontalScrollBar()->height()
- 2 * SignalMargin * traces.size()) * 1.0 / total_rows;
_signalHeight = (int)((height <= 0) ? 1 : height);
if (_session.get_device()->dev_inst()->mode == LOGIC) {
GVariant* gvar = _session.get_device()->get_config(NULL, NULL, SR_CONF_MAX_HEIGHT_VALUE);
if (gvar != NULL) {
max_height = (g_variant_get_byte(gvar) + 1) * MaxHeightUnit;
g_variant_unref(gvar);
}
_signalHeight = (int)((height <= 0) ? 1 : (height >= max_height) ? max_height : height);
} else {
_signalHeight = (int)((height <= 0) ? 1 : height);
}
_spanY = _signalHeight + 2 * SignalMargin;
int next_v_offset = SignalMargin;
BOOST_FOREACH(boost::shared_ptr<Trace> t, traces) {

View File

@@ -64,6 +64,7 @@ private:
static const int RulerHeight;
static const int MaxScrollValue;
static const int MaxHeightUnit;
public:
//static const int SignalHeight;