MCPcopy Create free account
hub / github.com/DreamSourceLab/DSView / update_scale_offset

Method update_scale_offset

DSView/pv/view/view.cpp:642–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

640}
641
642void View::update_scale_offset()
643{
644 int width = get_view_width();
645 if (width == 0){
646 return;
647 }
648
649 if (_device_agent->get_work_mode() != DSO) {
650 _maxscale = _session->cur_sampletime() / (width * MaxViewRate);
651 _minscale = (1.0 / _session->cur_snap_samplerate()) / MaxPixelsPerSample;
652 }
653 else {
654 _scale = _session->cur_view_time() / width;
655 _maxscale = 1e9;
656 _minscale = 1e-15;
657 }
658
659 _scale = max(min(_scale, _maxscale), _minscale);
660 _offset = max(min(_offset, get_max_offset()), get_min_offset());
661
662 _preScale = _scale;
663 _preOffset = _offset;
664
665 _ruler->update();
666 viewport_update();
667}
668
669void View::mode_changed()
670{

Callers

nothing calls this directly

Calls 5

get_work_modeMethod · 0.80
cur_sampletimeMethod · 0.80
cur_snap_samplerateMethod · 0.80
cur_view_timeMethod · 0.80
updateMethod · 0.45

Tested by

no test coverage detected