Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare release 1.6.1 #130

Merged
merged 59 commits into from
May 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
579d247
Fixed install script detection of pip3 when in a venv.
razman786 May 6, 2022
6644f78
Updated tigger-lsm dependency to version 1.7.1
razman786 May 6, 2022
0412b90
Version bump to 1.6.1
razman786 May 6, 2022
b423162
Updated README.rst with tigger-lsm version 1.7.1.
razman786 May 6, 2022
af8492d
Reimplemented Tigger's splash screen - useful when opening larger files.
razman786 May 6, 2022
8ef541b
Updated installer script and setup.py for Ubuntu 22.04. Currently, th…
razman786 May 7, 2022
7a7702e
Fix float error with updated API's/libs. Floating point Rect's and
razman786 May 7, 2022
9381a5c
Fixed install (via source) of PyQwt for Ubuntu 22.04.
razman786 May 7, 2022
749c439
Updated install script to use new deb package for PyQwt on Ubuntu 22.04.
razman786 May 7, 2022
3971686
Added new deb packages for PyQwt on Ubuntu 22.04.
razman786 May 7, 2022
8dd7599
Fixed float errors with updated API's/libs when loading a model.
razman786 May 7, 2022
bf0b00d
Fixed venv installation.
razman786 May 7, 2022
d9dcad4
Fixed from source build for Ubuntu 22.04.
razman786 May 7, 2022
84a8cf8
Updated github URL to ratts-ru.
razman786 May 7, 2022
6628492
Updated URL's to use ratt-ru.
razman786 May 7, 2022
cbe4831
Added .local to $PATH while installing.
razman786 May 7, 2022
35a53b8
Fixed VENV installation.
razman786 May 7, 2022
891aa68
Fixed source based installation, including with VENV.
razman786 May 7, 2022
ad705aa
Added Ubuntu 22.04 to GitHub Actions.
razman786 May 7, 2022
0d4ea59
Updated URL's to use ratt-ru.
razman786 May 7, 2022
c61dab2
Fixed logging output for successful installation.
razman786 May 8, 2022
1907ab2
Updated GitHub Actions:
razman786 May 8, 2022
e4b8b24
Fixed missed test updates for Ubuntu 22.04
razman786 May 8, 2022
f060fd3
Updated GitHub Actions:
razman786 May 8, 2022
66b4049
Reformatted file
razman786 May 9, 2022
c2493c0
Updated README.rst with Ubuntu 22.04 instructions.
razman786 May 9, 2022
3719ba9
Updated CHANGELOG for version 1.6.1
razman786 May 9, 2022
ea0ab2a
Fixed VENV vext.pyqt5 sipconfig error when installing on Ubuntu 22.04
razman786 May 9, 2022
b30e129
Added PyQwt Debian package for Ubuntu 22.04 ARM64
razman786 May 11, 2022
6bfa91e
Replaced 'python3 setup.py install' with pip install .
razman786 May 12, 2022
5d10ccf
Updated Actions failure step to output installer script logs by default.
razman786 May 12, 2022
c12d60b
Updated Actions failed test output order handling, and unified test o…
razman786 May 12, 2022
81c38c0
Added beta support for Ubuntu 22.04 ARM64
razman786 May 12, 2022
cb3109c
Updated CHANGELOG.rst for version 1.6.1
razman786 May 12, 2022
055614e
Updated README.rst with 'pip3 install', replacing the older 'setup.py…
razman786 May 12, 2022
2031522
Fixes issue #131 ARM64 installation.
razman786 May 12, 2022
0b52313
Refactored dockable widget handling. Main image and window will remain
razman786 May 13, 2022
c2d8e9f
Refactored dockable widget handling. Main window now remains in the same
razman786 May 13, 2022
893159d
Updated CHANGELOG.rst for version 1.6.1
razman786 May 13, 2022
ab4a310
Refctored zooming to be smoother, especially when using a trackpad.
razman786 May 14, 2022
ba7d805
Updated CHANGELOG.rst for version 1.6.1
razman786 May 14, 2022
38548a0
Fixes Ubuntu 18.04 test error with a screen size (640x480) being smal…
razman786 May 14, 2022
510ff17
Refined zoom by levels. Interaction with a trackpad is sensitive, but
razman786 May 15, 2022
bea3596
Added support to detect zooming on a trackpad or a mouse wheel
razman786 May 15, 2022
3b3f11a
The file selection dialog for opening FITS files now has a file preview
razman786 May 16, 2022
8d6af00
Updated CHANGELOG.rst for version 1.6.1
razman786 May 16, 2022
d970567
Fix none error when control dialog is loaded as a floating window from
razman786 May 16, 2022
412d123
Related to issue #129. The code has been refactored in terms of Qwt,
razman786 May 17, 2022
99c25d0
Disabled apt upgrade for Actions, as there is currently an error on
razman786 May 17, 2022
8f0e432
Updated shebangs and removed utf-8 declarations.
razman786 May 17, 2022
df12995
Updated copyright notices.
razman786 May 17, 2022
f80bef2
Updated About dialog copyright notice.
razman786 May 17, 2022
de75d3d
Fixed live profile selection when using mosaic images
razman786 May 22, 2022
52486f1
Updated compatible dependency versions
razman786 May 22, 2022
34c1327
Updated README.rst
razman786 May 22, 2022
42f7145
Updated README.rst badges and URL's
razman786 May 22, 2022
b6cd842
Updated README.rst with pypi actions badge
razman786 May 22, 2022
0f6bd33
Fixed window resinzing when dockwidget close while floating
razman786 May 23, 2022
0a01b5a
Fix native file dialog option for FITS header preview pane
razman786 May 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
354 changes: 323 additions & 31 deletions .github/workflows/installation.yml

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
Tigger Changelog
================

1.6.1
=====

* Version bump in preparation for release
* Supports Ubuntu 22.04
* Beta support for Ubuntu 22.04 ARM64
* Added FITS header preview pane to file dialog
* Dependent on the latest tigger-lsm (1.7.1)
* Fixed float errors with updated library API's
* Fixed dockable widgets and window sizing
* Refactored plot zooming
* Re-enabled splash screen
* Fixes venv pip3 bug
* Fixes issue #131
* Install script 'setup.py install' has been replaced by pip
* Updated URL's
* GitHub Actions are now compatible with 'act'
* Actions now test VENV installations on Ubuntu 20.04 and 22.04
* Improved Action tests and logging

1.6.0
=====

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
DOCKER_REPO=radioastro/tigger:1.6.0
DOCKER_REPO=radioastro/tigger:1.6.1

.PHONY: build clean

Expand Down
36 changes: 24 additions & 12 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@
Tigger
======

|actionsbadge| |actionspypibadge| |versionbadge|

.. |actionsbadge| image:: https://github.com/ratt-ru/tigger/workflows/Tigger%20Ubuntu%20CI/badge.svg
:target: https://github.com/ratt-ru/tigger/actions
.. |actionspypibadge| image:: https://github.com/ratt-ru/tigger/workflows/Deploy%20Python%20Package/badge.svg
:target: https://github.com/ratt-ru/tigger/actions
.. |versionbadge| image:: https://img.shields.io/github/v/release/ratt-ru/tigger
:target: https://github.com/ratt-ru/tigger/releases
:alt: GitHub release (latest by date)

.. image:: https://user-images.githubusercontent.com/7116312/113705452-5ac51d00-96d5-11eb-8087-5d2a8ccad99a.png

Installing Tigger
Expand All @@ -18,7 +28,7 @@ From source with Ubuntu LTS
Python dependencies
^^^^^^^^^^^^^^^^^^^

* Tigger-LSM v1.7.0 - if you are not installing Tigger via the KERN repository or using the ``install_tigger_ubuntu.sh`` script provided, please go here <https://github.com/ska-sa/tigger-lsm> and install this first.
* Tigger-LSM v1.7.1 - if you are not installing Tigger via the KERN repository or using the ``install_tigger_ubuntu.sh`` script provided, please go here <https://github.com/ratt-ru/tigger-lsm> and install this first.

Automatically installed Python dependencies:

Expand All @@ -42,9 +52,9 @@ Install on Ubuntu LTS with the installation script

Download the Tigger repository::

git clone https://github.com/ska-sa/tigger.git
git clone https://github.com/ratt-ru/tigger.git

The installation script works on Ubuntu 18.04, 20.04 and 21.04.
The installation script works on Ubuntu 18.04, 20.04 and 22.04 (including ARM64).

Run the installation script and enter ``sudo`` password when prompted::

Expand All @@ -53,13 +63,13 @@ Run the installation script and enter ``sudo`` password when prompted::
Manual installation from source
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

After the Tigger repository has been downloaded with ``git clone https://github.com/ska-sa/tigger.git``, please run the following::
After the Tigger repository has been downloaded with ``git clone https://github.com/ratt-ru/tigger.git``, please run the following::

sudo apt -y install python3-pyqt5.qtsvg python3-pyqt5.qtopengl libqwt-qt5-6
sudo dpkg -i debian_pkgs/ubuntu_20_04_deb_pkg/python3-pyqt5.qwt_2.00.00-1build1_amd64.deb
python3 setup.py install --user
sudo dpkg -i debian_pkgs/ubuntu_22_04_deb_pkg/python3-pyqt5.qwt_2.00.00-1build1_amd64.deb
pip3 install . --user

Please note that the above commands are for installing on Ubuntu 20.04, Debian packages for 18.04 and 21.04 are located in the ``ubuntu_18_04_deb_pkg`` and ``ubuntu_21_04_deb_pkg`` directories respectively.
Please note that the above commands are for installing on Ubuntu 22.04, Debian packages for 18.04, 20.04 and 22.04 ARM64 are located in the ``ubuntu_18_04_deb_pkg``, ``ubuntu_20_04_deb_pkg`` and ``ubuntu_20_04__arm64_deb_pkg`` directories respectively.

Running Tigger
==============
Expand All @@ -71,11 +81,13 @@ Questions or problems

Open an issue on github

https://github.com/ska-sa/tigger
https://github.com/ratt-ru/tigger/issues

Contributors
============

Travis
======
Thank you to the people who have contributed to this project.

.. image:: https://contrib.rocks/image?repo=ratt-ru/tigger
:target: https://github.com/ratt-ru/tigger/graphs/contributors

.. image:: https://travis-ci.org/ska-sa/tigger.svg?branch=master
:target: https://travis-ci.org/ska-sa/tigger
6 changes: 3 additions & 3 deletions TigGUI/AboutDialog.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down Expand Up @@ -89,8 +89,8 @@ def languageChange(self):
self.setWindowTitle(self.__tr("About Tigger"))
self.title_label.setText(self.__tr( \
"""<h3>Tigger %s</h3>
<p>\u00a92010-2021 Oleg Smirnov & Rhodes University & SKA SA<br>
<br>Please direct feedback and bug reports at https://github.com/ska-sa/tigger</p>
<p>\u00a92010-2022 Oleg Smirnov & Rhodes University & SKA SA<br>
<br>Please direct feedback and bug reports at https://github.com/ratt-ru/tigger</p>
""" % (release_string) \
))

Expand Down
2 changes: 1 addition & 1 deletion TigGUI/Images/Colormaps.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down
13 changes: 6 additions & 7 deletions TigGUI/Images/ControlDialog.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@

# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand All @@ -25,7 +24,7 @@
import numpy
from PyQt5.Qt import QWidget, QHBoxLayout, QComboBox, QLabel, QLineEdit, QDialog, QToolButton, QVBoxLayout, \
Qt, QSize, QSizePolicy, QApplication, QColor, QBrush, QTimer, QFrame, QCheckBox, QStackedWidget, QIcon, QMenu, \
QGridLayout, QPen, QRect
QGridLayout, QPen, QRectF
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QDockWidget
from PyQt5.Qwt import QwtPlot, QwtText, QwtPlotItem, QwtPlotCurve, QwtSymbol, QwtLinearScaleEngine, QwtLogScaleEngine, \
Expand Down Expand Up @@ -86,9 +85,9 @@ def __init__(self, parent, rc, imgman):
# lo0.setContentsMargins(0,0,0,0)

# histogram plot
whide = self.makeButton("Hide", self.hide, width=128)
whide.setShortcut(Qt.Key_F9)
lo0.addWidget(Separator(self, "Histogram and ITF", extra_widgets=[whide]))
self.whide = self.makeButton("Hide", self.hide, width=128)
self.whide.setShortcut(Qt.Key_F9)
lo0.addWidget(Separator(self, "Histogram and ITF", extra_widgets=[self.whide]))
lo1 = QHBoxLayout()
lo1.setContentsMargins(0, 0, 0, 0)
self._histplot = QwtPlot(self)
Expand Down Expand Up @@ -544,7 +543,7 @@ def draw(self, painter, xmap, ymap, rect):
# remap into an Nx1 image
qimg = self.cmap.colorize(self.imap.remap(xp.reshape((len(xp), 1))))
# plot image
painter.drawImage(QRect(xp1, y0, xdp, dy), qimg)
painter.drawImage(QRectF(xp1, y0, xdp, dy), qimg)

class HistogramLineMarker:
"""Helper class implementing a line marker for a histogram plot"""
Expand Down
68 changes: 50 additions & 18 deletions TigGUI/Images/Controller.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down Expand Up @@ -28,7 +28,7 @@
from PyQt5.QtGui import QFont
from PyQt5.QtWidgets import QDockWidget, QSizePolicy, QWidget, QPushButton, QStyle
from PyQt5.Qwt import QwtText, QwtPlotCurve, QwtPlotMarker, QwtScaleMap, QwtPlotItem
from PyQt5.QtCore import pyqtSignal, QPointF, QSize
from PyQt5.QtCore import pyqtSignal, QPoint, QPointF, QSize

import TigGUI.kitties.utils
from TigGUI.Images.SkyImage import FITSImagePlotItem
Expand Down Expand Up @@ -345,16 +345,22 @@ def showRenderControls(self):
if not self._control_dialog.isVisible():
dprint(1, "showing control dialog")
self._control_dialog.show()
self._dockable_colour_ctrl.setVisible(True)
self.addDockWidgetToTab()
self._dockable_colour_ctrl.show()
self._dockable_colour_ctrl.raise_()
if self._dockable_colour_ctrl is not None:
self._dockable_colour_ctrl.setVisible(True)
self.addDockWidgetToTab()
self._dockable_colour_ctrl.show()
self._dockable_colour_ctrl.raise_()
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)
else:
self._control_dialog.hide()
self._dockable_colour_ctrl.setVisible(False)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
self.parent().mainwin.setMaximumWidth(
self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() - self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)

def addDockWidgetToTab(self):
# Add dockable widget to main window.
Expand Down Expand Up @@ -396,17 +402,43 @@ def removeDockWidget(self):
def colourctrl_dockwidget_closed(self):
self._dockable_colour_ctrl.setVisible(False)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
self.parent().mainwin.setMaximumWidth(self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
if not self._dockable_colour_ctrl.isFloating():
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() - self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)

def colourctrl_dockwidget_toggled(self):
if self._dockable_colour_ctrl.isVisible():
if self._dockable_colour_ctrl.isWindow():
self._dockable_colour_ctrl.setFloating(False)
else:
self._dockable_colour_ctrl.setFloating(True)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
self.parent().mainwin.setMaximumWidth(
self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
if not self._dockable_colour_ctrl.isVisible():
return
if self._dockable_colour_ctrl.isWindow():
self._dockable_colour_ctrl.setFloating(False)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() + self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)
else:
self._dockable_colour_ctrl.setFloating(True)
if self.parent().mainwin.windowState() != Qt.WindowMaximized:
if not self.get_docked_widget_size(self._dockable_colour_ctrl):
geo = self.parent().mainwin.geometry()
geo.setWidth(self.parent().mainwin.width() - self._dockable_colour_ctrl.width())
self.parent().mainwin.setGeometry(geo)

def get_docked_widget_size(self, _dockable):
widget_list = self.parent().mainwin.findChildren(QDockWidget)
size_list = []
if _dockable:
for widget in widget_list:
if isinstance(widget.bind_widget, ImageControlDialog):
if widget is not _dockable:
if not widget.isWindow() and not widget.isFloating() and widget.isVisible():
size_list.append(widget.bind_widget.width())
if size_list:
return max(size_list)
else:
return size_list

def _changeDisplayRangeToPercent(self, percent):
if not self._control_dialog:
Expand Down
51 changes: 47 additions & 4 deletions TigGUI/Images/Manager.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand All @@ -20,15 +20,16 @@
#

import os.path
from re import split
import sys
import time
import traceback

import numpy
from PyQt5.Qt import (QWidget, QFileDialog, QVBoxLayout, QApplication, QMenu, QClipboard, QInputDialog, QActionGroup)
from PyQt5.Qt import (QWidget, QFileDialog, QVBoxLayout, QApplication, QMenu, QClipboard, QInputDialog, QActionGroup, QTextOption, QFont)
from PyQt5.QtCore import pyqtSignal
from PyQt5.QtCore import Qt
from PyQt5.QtWidgets import QDockWidget
from PyQt5.QtWidgets import QDockWidget, QLabel, QPlainTextEdit
from astropy.io import fits as pyfits

from TigGUI.Images import FITS_ExtensionList
Expand Down Expand Up @@ -89,6 +90,8 @@ def __init__(self, *args):
self._repopulateMenu()
self.signalShowMessage = None
self.signalShowErrorMessage = None
# FITS header preview pane
self.fits_info = QPlainTextEdit()

def close(self):
dprint(1, "closing Manager")
Expand All @@ -105,6 +108,25 @@ def setShowErrorMessageSignal(self, _signal):
def setMainWindow(self, _mainwin):
self.mainwin = _mainwin

def FITSHeaderPreview(self, fname):
"""Loads information for the FITS header preview pane.
Connected via the QFileDialog currentChanged signal.
"""
if os.path.isfile(fname):
name = os.path.basename(fname)
split_name = os.path.splitext(name)
if split_name[1].startswith(tuple(FITS_ExtensionList)):
try:
with pyfits.open(fname) as hdu:
hdu.verify('silentfix')
hdr = hdu[0].header
self.fits_info.setPlainText(
"[File size: " + str(round(hdu._file.tell()/1024/1024, 2)) + " MiB]\n" + hdr.tostring(sep='\n', padding=True))
except:
self.fits_info.setPlainText("Error Reading FITS file")
else:
self.fits_info.clear()

def loadImage(self, filename=None, duplicate=True, to_top=True, model=None):
"""Loads image. Returns ImageControlBar object.
If image is already loaded: returns old ICB if duplicate=False (raises to top if to_top=True),
Expand All @@ -116,10 +138,31 @@ def loadImage(self, filename=None, duplicate=True, to_top=True, model=None):
if not self._load_image_dialog:
dialog = self._load_image_dialog = QFileDialog(self, "Load FITS image", ".",
"FITS images (%s);;All files (*)" % (" ".join(
["*" + ext for ext in FITS_ExtensionList])))
["*" + ext for ext in FITS_ExtensionList])),
options=QFileDialog.DontUseNativeDialog)
dialog.setFileMode(QFileDialog.ExistingFile)
dialog.setModal(True)
dialog.filesSelected['QStringList'].connect(self.loadImage)
layout = dialog.layout()
if layout:
# FITS header preview pane
dialog.currentChanged.connect(self.FITSHeaderPreview)
self.fits_info.setMinimumWidth(263)
dialog.setMinimumWidth(dialog.width() + self.fits_info.minimumWidth())
self.fits_info.setWordWrapMode(QTextOption.NoWrap)
self.fits_info.setLineWrapMode(QPlainTextEdit.NoWrap)
self.fits_info.setTabStopWidth(40)
f = QFont()
f.setFamily("Monospace")
f.setPointSize(10)
f.setFixedPitch(True)
self.fits_info.setFont(f)
self.fits_info.setReadOnly(True)
_flabel = QLabel("FITS File Information")
_flabel.setAlignment(Qt.AlignHCenter)
layout.addWidget(_flabel, 0, 3)
layout.addWidget(self.fits_info, 1, 3, 3, 1)
dialog.setLayout(layout)
self._load_image_dialog.exec_()
return None
if isinstance(filename, QStringList):
Expand Down
2 changes: 1 addition & 1 deletion TigGUI/Images/RenderControl.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down
6 changes: 3 additions & 3 deletions TigGUI/Images/SkyImage.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down Expand Up @@ -239,7 +239,7 @@ def draw(self, painter, xmap, ymap, rect, use_cache=True):
yp1, yp2, ydp, ys1, ys2, yds = yinfo = ymap.p1(), ymap.p2(), ymap.pDist(), ymap.s1(), ymap.s2(), ymap.sDist()
dprint(5, "draw:", rect, xinfo, yinfo)
self._current_rect = QRectF(QPointF(xs2, ys1), QSizeF(xds, yds))
self._current_rect_pix = QRect(QPoint(*self.lmToPix(xs1, ys1)), QPoint(*self.lmToPix(xs2, ys2))).intersected(
self._current_rect_pix = QRectF(QPointF(*self.lmToPix(xs1, ys1)), QPointF(*self.lmToPix(xs2, ys2))).toRect().intersected(
self._bounding_rect_pix)
dprint(5, "draw:", self._current_rect_pix)
# put together tuple describing current mapping
Expand Down Expand Up @@ -338,7 +338,7 @@ def draw(self, painter, xmap, ymap, rect, use_cache=True):
self._cache_qimage[self._image_key] = self.qimg.copy()
# now draw the image
t0 = time.time()
painter.drawImage(xp1, yp2, self.qimg)
painter.drawImage(QPointF(xp1, yp2), self.qimg)
dprint(2, "drawing took", time.time() - t0, "secs")
# when exporting images to PNG cache needs to be cleared
if not use_cache:
Expand Down
2 changes: 1 addition & 1 deletion TigGUI/Images/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (C) 2002-2011
# Copyright (C) 2002-2022
# The MeqTree Foundation &
# ASTRON (Netherlands Foundation for Research in Astronomy)
# P.O.Box 2, 7990 AA Dwingeloo, The Netherlands
Expand Down
Loading