Only update speca weather if it not already updating. Also remove QPixmaps if already displayed
This commit is contained in:
@@ -463,8 +463,9 @@ class Artemis(QMainWindow, Ui_MainWindow):
|
||||
|
||||
@pyqtSlot()
|
||||
def start_update_space_weather(self):
|
||||
self.update_now_bar.setMaximum(self.update_now_bar.minimum())
|
||||
self.space_weather_data.update()
|
||||
if not self.space_weather_data.is_updating:
|
||||
self.update_now_bar.setMaximum(self.update_now_bar.minimum())
|
||||
self.space_weather_data.update()
|
||||
|
||||
@pyqtSlot(bool)
|
||||
def update_space_weather(self, status_ok):
|
||||
|
||||
@@ -104,9 +104,9 @@ class Constants(object):
|
||||
FORECAST_IMG_3 = "http://www.mmmonvhf.de/solar/solar.png"
|
||||
FORECAST_IMG_4 = "http://amunters.home.xs4all.nl/eskipstatusNA.gif"
|
||||
FORECAST_IMG_5 = "http://amunters.home.xs4all.nl/aurorastatus.gif"
|
||||
FORECAST_IMG_6 = "http://amunters.home.xs4all.nl/eskip50status.gif"
|
||||
FORECAST_IMG_7 = "http://amunters.home.xs4all.nl/eskip70status.gif"
|
||||
FORECAST_IMG_8 = "http://amunters.home.xs4all.nl/eskipstatus.gif"
|
||||
FORECAST_IMG_6 = "http://amunters.home.xs4all.nl/eskipstatus.gif"
|
||||
FORECAST_IMG_7 = "http://amunters.home.xs4all.nl/eskip50status.gif"
|
||||
FORECAST_IMG_8 = "http://amunters.home.xs4all.nl/eskip70status.gif"
|
||||
SEARCH_LABEL_IMG = "search_icon.png"
|
||||
VOLUME_LABEL_IMG = "volume.png"
|
||||
DATA_FOLDER = "Data"
|
||||
|
||||
@@ -24,6 +24,10 @@ class SpaceWeatherData(QObject):
|
||||
self.__update_thread = UpadteSpaceWeatherThread(self)
|
||||
self.__update_thread.finished.connect(self.__parse_and_emit_signal)
|
||||
|
||||
@property
|
||||
def is_updating(self):
|
||||
return self.__update_thread.isRunning()
|
||||
|
||||
@pyqtSlot()
|
||||
def update(self):
|
||||
self.__update_thread.start()
|
||||
@@ -42,6 +46,15 @@ class SpaceWeatherData(QObject):
|
||||
self.ak_index = ''
|
||||
self.sgas = ''
|
||||
self.geo_storm = ''
|
||||
self.images = [QPixmap(),
|
||||
QPixmap(),
|
||||
QPixmap(),
|
||||
QPixmap(),
|
||||
QPixmap(),
|
||||
QPixmap(),
|
||||
QPixmap(),
|
||||
QPixmap(),
|
||||
QPixmap()]
|
||||
|
||||
@pyqtSlot()
|
||||
def __parse_and_emit_signal(self):
|
||||
|
||||
Reference in New Issue
Block a user