diff --git a/artemis.py b/artemis.py index 1cbceca..a6cd62c 100644 --- a/artemis.py +++ b/artemis.py @@ -415,21 +415,21 @@ class Artemis(QMainWindow, Ui_MainWindow): self.switchable_g_now_labels, self.switchable_g_today_labels), colors_array * 4): - lab.set_colors(light_color, dark_color) + lab.set_colors(None, None) k_storms_colors = [[Colors.RED_LIGHT, Colors.RED_DARK], [Colors.RED2_LIGHT, Colors.RED2_DARK], [Colors.RED3_LIGHT, Colors.RED3_DARK], - [Colors.ORANGE_LIGHT, Colors.ORANGE_DARK], [Colors.ORANGE2_LIGHT, Colors.ORANGE2_DARK], + [Colors.ORANGE_LIGHT, Colors.ORANGE_DARK], [Colors.YELLOW_LIGHT, Colors.YELLOW_DARK], - [Colors.GREEN3_LIGHT, Colors.GREEN3_DARK], [Colors.GREEN2_LIGHT, Colors.GREEN2_DARK], + [Colors.GREEN3_LIGHT, Colors.GREEN3_DARK], [Colors.GREEN_LIGHT, Colors.GREEN_DARK], [Colors.BLUE_LIGHT, Colors.BLUE_DARK]] a_storm_colors = [[Colors.RED_LIGHT, Colors.RED_DARK], - [Colors.ORANGE_LIGHT, Colors.ORANGE_DARK], [Colors.ORANGE2_LIGHT, Colors.ORANGE2_DARK], + [Colors.ORANGE_LIGHT, Colors.ORANGE_DARK], [Colors.YELLOW_LIGHT, Colors.YELLOW_DARK], [Colors.GREEN_LIGHT, Colors.GREEN_DARK], [Colors.BLUE_LIGHT, Colors.BLUE_DARK]] @@ -453,7 +453,7 @@ class Artemis(QMainWindow, Ui_MainWindow): for lab, [light_color, dark_color] in zip(chain(self.k_storm_labels, self.a_storm_labels), chain(k_storms_colors, a_storm_colors)): - lab.set_colors(light_color, dark_color) + lab.set_colors(None, None) # Final operations. self.theme.initialize() @@ -571,27 +571,56 @@ class Artemis(QMainWindow, Ui_MainWindow): k_index_24_hmax = int(self.space_weather_data.geo_storm[6][index]) if k_index_24_hmax == 0: self.switchable_g_today_labels.switch_on(self.g0_today_lbl) + self.expected_noise_lbl.setText("S0 - S1 (<-120 dBm)") elif k_index_24_hmax == 1: self.switchable_g_today_labels.switch_on(self.g0_today_lbl) + self.expected_noise_lbl.setText("S0 - S1 (<-120 dBm)") elif k_index_24_hmax == 2: self.switchable_g_today_labels.switch_on(self.g0_today_lbl) + self.expected_noise_lbl.setText("S1 - S2 (-115 dBm)") elif k_index_24_hmax == 3: self.switchable_g_today_labels.switch_on(self.g0_today_lbl) + self.expected_noise_lbl.setText("S2 - S3 (-110 dBm)") elif k_index_24_hmax == 4: self.switchable_g_today_labels.switch_on(self.g0_today_lbl) + self.expected_noise_lbl.setText("S3 - S4 (-100 dBm)") elif k_index_24_hmax == 5: self.switchable_g_today_labels.switch_on(self.g1_today_lbl) + self.expected_noise_lbl.setText("S4 - S6 (-90 dBm)") elif k_index_24_hmax == 6: self.switchable_g_today_labels.switch_on(self.g2_today_lbl) + self.expected_noise_lbl.setText("S6 - S9 (-80 dBm)") elif k_index_24_hmax == 7: self.switchable_g_today_labels.switch_on(self.g3_today_lbl) + self.expected_noise_lbl.setText("S9 - S20 (>-60 dBm)") elif k_index_24_hmax == 8: self.switchable_g_today_labels.switch_on(self.g4_today_lbl) + self.expected_noise_lbl.setText("S20 - S30 (>-60 dBm)") elif k_index_24_hmax == 9: self.switchable_g_today_labels.switch_on(self.g5_today_lbl) + self.expected_noise_lbl.setText("S30+ (>>-60 dBm)") + self.expected_noise_lbl.setStyleSheet(f""" + color:#ffffff; + background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #4776e6 ,stop: 1 #8e54e9);""") - self.sfi_lbl.setText(self.space_weather_data.ak_index[7][2].replace('.', '').lstrip('0')) - self.sn_lbl.setText([x[4] for i, x in enumerate(self.space_weather_data.sgas) if "SSN" in x][0].lstrip('0')) + val = int(self.space_weather_data.ak_index[7][2].replace('.', '')) + self.sfi_lbl.setText(f"{val}") + val = int([x[4] for x in self.space_weather_data.sgas if "SSN" in x][0]) + self.sn_lbl.setText(f"{val:d}") + + forecast_labels = (self.forecast_lbl_0, + self.forecast_lbl_1, + self.forecast_lbl_2, + self.forecast_lbl_3, + self.forecast_lbl_4, + self.forecast_lbl_5, + self.forecast_lbl_6, + self.forecast_lbl_7, + self.forecast_lbl_8) + for label, pixmap in zip(forecast_labels, self.space_weather_data.images): + label.setText('') + label.setPixmap(pixmap) + label.setScaledContents(True) else: pop_up(self, title = Messages.BAD_DOWNLOAD, @@ -632,7 +661,7 @@ class Artemis(QMainWindow, Ui_MainWindow): def show_matching_strings(self, list_elements, text): for index in range(list_elements.count()): item = list_elements.item(index) - if text.upper() in item.text() or item.isSelected(): + if text.lower() in item.text().lower() or item.isSelected(): item.setHidden(False) else: item.setHidden(True) diff --git a/artemis.ui b/artemis.ui index 920bdb3..1b5ac82 100644 --- a/artemis.ui +++ b/artemis.ui @@ -178,7 +178,7 @@ QTabWidget::Rounded - 3 + 0 true @@ -4604,704 +4604,1062 @@ www.qrg.globaltuners.com Now - - - - - - - + + + + + 0 + 0 + + + + + + + + 0 + 0 + + + + + 13 + 75 + true + true + + + + X-Rays + + + + + + + + + + 0 + 0 + + 11 - 75 - true - true - X-Rays + Radio Blackout - - - - - 11 - 75 - true - true - + + + + + 0 + 0 + - - Protons-Electrons Flux - - - - - - - - - - 9 - - - - Solar Radiation Storm - - - - - - - - - - - 75 - true - - - - S0 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - S1 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - S2 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - S3 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - S4 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - S5 - - - Qt::AlignCenter - - - - - - - - - - - - - 11 - 75 - true - true - - - - Solar Activity - - - - - - - - - - 9 - 75 - true - - - - K-Index - - - - - - - - 9 - - - - - - - - - - - - - - - - - 9 - 75 - true - - - - A-Index - - - - - - - - 9 - - - - - - - - - - - - - + + + 2 + - + - 9 + 10 75 true + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + - EXTREMELY SEVERE + R0 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + R1 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + R2 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + R3 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + R4 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + R5 + + + Qt::AlignCenter + + + + + + + + + + + + + 0 + 0 + + + + + 13 + 75 + true + true + + + + Protons-Electrons Flux + + + + + + + + + + 0 + 0 + + + + + 11 + + + + Solar Radiation Storm + + + + + + + + 0 + 0 + + + + + 2 + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + S0 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + S1 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + S2 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + S3 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + S4 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + S5 + + + Qt::AlignCenter + + + + + + + + + + + + + 0 + 0 + + + + + 13 + 75 + true + true + + + + Solar Activity + + + + + + + + + + 0 + 0 + + + + + 11 + 75 + true + + + + K-Index: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 12 + + + + - + + + + + + + + + + + + 0 + 0 + + + + + 11 + 75 + true + + + + A-Index: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + + 0 + 0 + + + + + 12 + + + + - + + + + + + + + + + 0 + 0 + + + + + 1 + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + EXTREMELY SEVERE STORM - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - VERY SEVERE STORM - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - SEVERE STORM - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - MAJOR STORM - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - MINOR STORM - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - ACTIVE - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - UNSETTLED - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - QUIET - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - VERY QUIET - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - INACTIVE - - - Qt::AlignCenter - - - - + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + VERY SEVERE STORM + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + SEVERE STORM + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + MAJOR STORM + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + MINOR STORM + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + ACTIVE + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + UNSETTLED + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + QUIET + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + VERY QUIET + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + INACTIVE + + + Qt::AlignCenter + + + + + + + + + + + 0 + 0 + + + + + 1 + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + SEVERE STORM + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + MAJOR STORM + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + MINOR STORM + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + ACTIVE + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + UNSETTLED + + + Qt::AlignCenter + + + + + + + + 0 + 0 + + + + + 9 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + QUIET + + + Qt::AlignCenter + + + + + + + + + + + + + 0 + 0 + + + + + 11 + 75 + true + + + + SFI: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + - - - - - - - - 9 - 75 - true - - - - SEVERE STORM - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - MAJOR STORM - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - MINOR STORM - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - ACTIVE - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - UNSETTLED - - - Qt::AlignCenter - - - - - - - - 9 - 75 - true - - - - QUIET - - - Qt::AlignCenter - - - - + + + + + 0 + 0 + + + + + 12 + + + + - + - - - - - - - 9 - 75 - true - - - - SFI - - - - - - - - 9 - - - - - - - - - + + + + + + + + + 0 + 0 + + + + + 11 + 75 + true + + + + SN: + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + - - - - - - - 9 - 75 - true - - - - SN - - - - - - - - 9 - - - - - - - - - + + + + + 0 + 0 + + + + + 12 + + + + - + + - - - - - - - 9 - - - - Geomagnetic Storm (MAX 24 hrs) - - - - - - - - - - - 75 - true - - - - G0 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - G1 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - G2 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - G3 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - G4 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - G5 - - - Qt::AlignCenter - - - - - - - - - - + + + + + + + + + 0 + 0 + + - 9 + 11 @@ -5309,17 +5667,53 @@ STORM + + + + + 0 + 0 + + + + + 11 + + + + Geomagnetic Storm (MAX 24 hrs) + + + + + + + + + + 0 + 0 + + + + 2 + + 10 75 true + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + G0 @@ -5332,10 +5726,15 @@ STORM + 10 75 true + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + G1 @@ -5348,10 +5747,15 @@ STORM + 10 75 true + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + G2 @@ -5364,10 +5768,15 @@ STORM + 10 75 true + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + G3 @@ -5380,10 +5789,15 @@ STORM + 10 75 true + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + G4 @@ -5396,10 +5810,156 @@ STORM + 10 75 true + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + G5 + + + Qt::AlignCenter + + + + + + + + + + + 0 + 0 + + + + + 2 + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + G0 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + G1 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + G2 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + G3 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + G4 + + + Qt::AlignCenter + + + + + + + + 10 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + G5 @@ -5413,160 +5973,586 @@ STORM - - - - - - - 9 - - - - Peak Flux Class - - - - - - - - 9 - - - - - - - - Qt::AlignCenter - - - - + + + + + + + + + 0 + 0 + + + + + 11 + + + + Peak Flux Class + + - - - - - - - 9 - - - - Radio Blackout - - - - - - - - - - - 75 - true - - - - R0 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - R1 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - R2 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - R3 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - R4 - - - Qt::AlignCenter - - - - - - - - 75 - true - - - - R5 - - - Qt::AlignCenter - - - - - - - + + + + + 0 + 0 + + + + + 9 + + + + - + + + Qt::AlignCenter + + - - - - + + + + + + + + QFrame::Sunken + + + 1 + + + 0 + + + Qt::Vertical + + + + + + + + 0 + 0 + + + + + + + + 13 + 75 + true + true + + + + Propagation Data + + + + + + + + 0 + 0 + + + + + + + + 0 + 0 + + + + + 11 + true + + + + E.M.E + + + + + + + + 12 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + OFF + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 12 + + + + + + + + 0 + 0 + + + + + 11 + true + + + + Meteor Scatter + + + + + + + + 12 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + OFF + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 12 + + + + + + + + 0 + 0 + + + + + 11 + true + + + + M.U.F. + + + + + + + + 12 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + OFF + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 12 + + + + + + + + 0 + 0 + + + + + 11 + true + + + + Hystorical Index + + + + + + + + 12 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + OFF + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 12 + + + + + + + + 0 + 0 + + + + + 11 + true + + + + 50 MHz in EU + + + + + + + + 12 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + OFF + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 12 + + + + + + + + 0 + 0 + + + + + 11 + true + + + + 70 MHz in EU + + + + + + + + 12 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + OFF + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 12 + + + + + + + + 0 + 0 + + + + + 11 + true + + + + 144 MHz in EU + + + + + + + + 0 + 0 + + + + + 11 + true + + + + 144 MHz in NA + + + + + + + + 12 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + OFF + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 12 + + + + + + + + 0 + 0 + + + + + 11 + true + + + + VHF Aurora + + + + + + + + 12 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + OFF + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 12 + + + + + + + + 12 + 75 + true + + + + color:#ffffff; +background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + + + OFF + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter + + + 12 + + + + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 10 + + + + + + + + + 0 + 0 + + + + + 13 + 75 + true + true + + + + Expected HF Noise + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 5 + + + + + + + + + 0 + 0 + + + + + 13 + 75 + true + + + + + + + Qt::AlignCenter + + + + + + + Qt::Vertical + + + QSizePolicy::Minimum + + + + 20 + 10 + + + + + @@ -5614,9 +6600,9 @@ STORM - - - + + + diff --git a/constants.py b/constants.py index b4c6ec7..e513bf8 100644 --- a/constants.py +++ b/constants.py @@ -67,28 +67,28 @@ class Database(object): Signal.CATEGORY_CODE,) class Colors(object): - RED_DARK = "#4d0000" - RED_LIGHT = "#ff0000" + RED_DARK = "#4d0000" + RED_LIGHT = "#ff0000" RED2_DARK = "#4c0c00" RED2_LIGHT = "#ff2700" RED3_DARK = "#4b1100" RED3_LIGHT = "#ff3a00" - ORANGE_DARK = "#4d2e00" - ORANGE_LIGHT = "#ffad33" + ORANGE_DARK = "#4d2e00" + ORANGE_LIGHT = "#ffad33" ORANGE2_DARK = "#4c2000" ORANGE2_LIGHT = "#ff6c00" - GREEN_DARK = "#003300" - GREEN_LIGHT = "#33ff33" + GREEN_DARK = "#003300" + GREEN_LIGHT = "#33ff33" GREEN2_DARK = "#424d00" GREEN2_LIGHT = "#dcff00" GREEN3_DARK = "#344d00" GREEN3_LIGHT = "#aeff00" - BLUE_DARK = "#000033" - BLUE_LIGHT = "#3333ff" - WHITE_DARK = "#333333" - WHITE_LIGHT = "#d9b3ff" - YELLOW_DARK = "#333300" - YELLOW_LIGHT = "#ffff33" + BLUE_DARK = "#000033" + BLUE_LIGHT = "#3333ff" + WHITE_DARK = "#333333" + WHITE_LIGHT = "#d9b3ff" + YELLOW_DARK = "#333300" + YELLOW_LIGHT = "#ffff33" class Constants(object): ACF_DOCS = "https://aresvalley.com/documentation/" @@ -98,6 +98,15 @@ class Constants(object): FORECAST_SGAS = "https://services.swpc.noaa.gov/text/sgas.txt" FORECAST_G = "https://services.swpc.noaa.gov/text/3-day-forecast.txt" FORECAST_INFO = "https://www.swpc.noaa.gov/sites/default/files/images/NOAAscales.pdf" + FORECAST_IMG_0 = "http://www.mmmonvhf.de/eme/eme.png" + FORECAST_IMG_1 = "http://www.mmmonvhf.de/ms/ms.png" + FORECAST_IMG_2 = "http://www.mmmonvhf.de/es/es.png" + 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" SEARCH_LABEL_IMG = "search_icon.png" VOLUME_LABEL_IMG = "volume.png" DATA_FOLDER = "Data" diff --git a/space_weather_data.py b/space_weather_data.py index 694c4c8..52bf30a 100644 --- a/space_weather_data.py +++ b/space_weather_data.py @@ -1,5 +1,5 @@ +from PyQt5.QtGui import QPixmap from PyQt5.QtCore import pyqtSlot, pyqtSignal, QObject - from threads import UpadteSpaceWeatherThread, ThreadStatus class SpaceWeatherData(QObject): @@ -12,6 +12,15 @@ class SpaceWeatherData(QObject): self.ak_index = '' self.sgas = '' self.geo_storm = '' + self.images = [QPixmap(), + QPixmap(), + QPixmap(), + QPixmap(), + QPixmap(), + QPixmap(), + QPixmap(), + QPixmap(), + QPixmap()] self.__update_thread = UpadteSpaceWeatherThread(self) self.__update_thread.finished.connect(self.__parse_and_emit_signal) diff --git a/switchable_label.py b/switchable_label.py index 68639b6..5d32e89 100644 --- a/switchable_label.py +++ b/switchable_label.py @@ -11,12 +11,24 @@ class SwitchableLabel(QLabel): self.switch_off_color = off def switch_on(self): - self.setStyleSheet(f"""background-color: {self.switch_on_color}; - color:#000000;""") + if self.switch_on_color and self.switch_off_color: + self.setStyleSheet(f"""background-color: {self.switch_on_color}; + color:#000000;""") + else: + self.setStyleSheet(""" + color:#ffffff; + background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #4776e6 ,stop: 1 #8e54e9); + """) def switch_off(self): - self.setStyleSheet(f"""background-color: {self.switch_off_color}; - color:#000000;""") + if self.switch_on_color and self.switch_off_color: + self.setStyleSheet(f"""background-color: {self.switch_off_color}; + color:#000000;""") + else: + self.setStyleSheet(""" + color:#ffffff; + background-color: qlineargradient(x1: 0, y1: 0, x2: 1, y2: 0,stop:0 #283048 ,stop: 1 #859398); + """) class SwitchableLabelsIterable(object): diff --git a/themes.py b/themes.py index db2cb69..8d9f419 100644 --- a/themes.py +++ b/themes.py @@ -1,7 +1,7 @@ from functools import partial import os import re -from PyQt5.QtWidgets import QAction +from PyQt5.QtWidgets import QAction, QActionGroup from PyQt5.QtCore import pyqtSlot from PyQt5.QtGui import QPixmap from constants import Constants @@ -29,6 +29,7 @@ class Theme(object): self.__parent.default_images_folder = os.path.join(ThemeConstants.FOLDER, ThemeConstants.DEFAULT, ThemeConstants.ICONS_FOLDER) + self.__theme_names = {} self.__detect_themes() def __refresh_range_labels(self): @@ -60,21 +61,26 @@ class Theme(object): self.__refresh_range_labels() self.__parent.audio_widget.refresh_btns_colors(self.__parent.active_color, self.__parent.inactive_color) + def __pretty_name(self, bad_name): + return ' '.join( + map(lambda s: s.capitalize(), + bad_name.split('-')[1].split('_') + ) + ) + def __detect_themes(self): themes = [] + ag = QActionGroup(self.__parent, exclusive = True) for theme_folder in os.listdir(ThemeConstants.FOLDER): relative_folder = os.path.join(ThemeConstants.FOLDER, theme_folder) if os.path.isdir(os.path.abspath(relative_folder)): relative_folder = os.path.join(ThemeConstants.FOLDER, theme_folder) themes.append(relative_folder) for theme_path in themes: - theme_name = '&' + ' '.join( - map(lambda s: s.capitalize(), - os.path.basename(theme_path).split('-')[1].split('_') - ) - ) - new_theme = QAction(theme_name, self.__parent) + theme_name = '&' + self.__pretty_name(os.path.basename(theme_path)) + new_theme = ag.addAction(QAction(theme_name, self.__parent, checkable = True)) self.__parent.menu_themes.addAction(new_theme) + self.__theme_names[theme_name.lstrip('&')] = new_theme new_theme.triggered.connect(partial(self.__apply, theme_path)) def __change(self): @@ -163,5 +169,9 @@ class Theme(object): if os.path.exists(current_theme_file): with open(current_theme_file, "r") as current_theme_path: theme_path = current_theme_path.read() + theme_name = self.__pretty_name(os.path.basename(theme_path)) + self.__theme_names[theme_name].setChecked(True) if theme_path != ThemeConstants.DEFAULT: self.__apply(theme_path) + else: + self.__theme_names[self.__pretty_name(ThemeConstants.DEFAULT)].setChecked(True) diff --git a/threads.py b/threads.py index 8ea2cbb..0ca188b 100644 --- a/threads.py +++ b/threads.py @@ -78,5 +78,14 @@ class UpadteSpaceWeatherThread(QThread): self.__space_weather_data.ak_index = str(urllib3.PoolManager().request('GET', Constants.FORECAST_AK_IND).data, 'utf-8') self.__space_weather_data.sgas = str(urllib3.PoolManager().request('GET', Constants.FORECAST_SGAS).data, 'utf-8') self.__space_weather_data.geo_storm = str(urllib3.PoolManager().request('GET', Constants.FORECAST_G).data, 'utf-8') + self.__space_weather_data.images[0].loadFromData(urllib3.PoolManager().request('GET', Constants.FORECAST_IMG_0).data) + self.__space_weather_data.images[1].loadFromData(urllib3.PoolManager().request('GET', Constants.FORECAST_IMG_1).data) + self.__space_weather_data.images[2].loadFromData(urllib3.PoolManager().request('GET', Constants.FORECAST_IMG_2).data) + self.__space_weather_data.images[3].loadFromData(urllib3.PoolManager().request('GET', Constants.FORECAST_IMG_3).data) + self.__space_weather_data.images[4].loadFromData(urllib3.PoolManager().request('GET', Constants.FORECAST_IMG_4).data) + self.__space_weather_data.images[5].loadFromData(urllib3.PoolManager().request('GET', Constants.FORECAST_IMG_5).data) + self.__space_weather_data.images[6].loadFromData(urllib3.PoolManager().request('GET', Constants.FORECAST_IMG_6).data) + self.__space_weather_data.images[7].loadFromData(urllib3.PoolManager().request('GET', Constants.FORECAST_IMG_7).data) + self.__space_weather_data.images[8].loadFromData(urllib3.PoolManager().request('GET', Constants.FORECAST_IMG_8).data) except: self.__status = ThreadStatus.UNKNOWN_ERR