Rewrite to make it more modular
added veiws for area and single waveforms added settings dialog added MenuBar and populated with "View" "Settings" and "Help" Help menu contains "About" currently ** ** WILL NOT RUN due to rewrite being incomplete ** **
This commit is contained in:
2
config/__init__.py
Normal file
2
config/__init__.py
Normal file
@@ -0,0 +1,2 @@
|
||||
from .areas_config import AREAS_OF_INTEREST
|
||||
from .stations_config import ALL_STATIONS_CONFIG, SENSOR_TYPE_CHANNELS, STATION_LOOKUP
|
BIN
config/__pycache__/__init__.cpython-313.pyc
Normal file
BIN
config/__pycache__/__init__.cpython-313.pyc
Normal file
Binary file not shown.
BIN
config/__pycache__/areas_config.cpython-313.pyc
Normal file
BIN
config/__pycache__/areas_config.cpython-313.pyc
Normal file
Binary file not shown.
BIN
config/__pycache__/stations_config.cpython-313.pyc
Normal file
BIN
config/__pycache__/stations_config.cpython-313.pyc
Normal file
Binary file not shown.
@@ -1,66 +0,0 @@
|
||||
QMainWindow {
|
||||
background-color: #A7FAFC;
|
||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Halvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
|
||||
}
|
||||
|
||||
QLabel, QGroupBox, QWidget, QComboBox, QPushButton {
|
||||
color: #1A202C;
|
||||
}
|
||||
|
||||
QLabel#headerLabel {
|
||||
font-size: 32px;
|
||||
font-weight: bold;
|
||||
color: #1A202C;
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
|
||||
QLabel {
|
||||
font-size: 16px;
|
||||
color: #4A5568;
|
||||
}
|
||||
|
||||
QLabel[property="controlLabel"] {
|
||||
font-weight: bold;
|
||||
color: #333333;
|
||||
}
|
||||
|
||||
QComboBox {
|
||||
padding: 5px;
|
||||
border: 1px solid #CBD5E0;
|
||||
border-radius: 4ps;
|
||||
background-color: white;
|
||||
}
|
||||
|
||||
QComboBox::drop-down {
|
||||
border-left: 1px solid #CBD5E0;
|
||||
width: 20px;
|
||||
}
|
||||
|
||||
QComboBox::down-arrow {
|
||||
|
||||
}
|
||||
|
||||
QPushButton {
|
||||
background-color: #3B82F6;
|
||||
color: white;
|
||||
border: none;
|
||||
padding: 8px 16px;
|
||||
border-radius: 6px;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
QPushButton:hover {
|
||||
background-color: #2563EB;
|
||||
}
|
||||
|
||||
QPushButton:disabled {
|
||||
background-color: #9CA3AF;
|
||||
color: #E5E7EB;
|
||||
}
|
||||
|
||||
QWidget#waveformChartContainer {
|
||||
background-color: white;
|
||||
border: 1px solid #E2E8F0;
|
||||
border-radius: 8px;
|
||||
padding: 16px;
|
||||
}
|
173
config/areas_config.py
Normal file
173
config/areas_config.py
Normal file
@@ -0,0 +1,173 @@
|
||||
# DICTIONARY mapping area names to a list of station codes belonging to that area.
|
||||
#
|
||||
# Each station config in the list is a dictionary:
|
||||
# {
|
||||
# code: StationCode
|
||||
# preferred_channel: channelCode
|
||||
# preferred_location: locationCode
|
||||
# }
|
||||
AREAS_OF_INTEREST = {
|
||||
"Northland & Auckland": [
|
||||
|
||||
],
|
||||
"Waikato": [
|
||||
|
||||
],
|
||||
"Hikaurangi Subduction Zone": [
|
||||
{
|
||||
"code": "RIZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "GLKZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
|
||||
},
|
||||
{
|
||||
"code": "MXZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "WMGZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "PUZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "CNGZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "RIGZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "PRGZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "KNZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "WHHZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "ARHZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "CKHZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "KAHZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "PXZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "PRHZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "BFZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "CPWZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "TMWZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "TRWZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "WRRZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "CMWZ",
|
||||
"preferred_channel": "EHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "BSWZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
{
|
||||
"code": "CTZ",
|
||||
"preferred_channel": "HHE",
|
||||
"preferred_location": "10"
|
||||
},
|
||||
],
|
||||
"Rotorua & East Cape": [
|
||||
|
||||
],
|
||||
"White Island": [
|
||||
|
||||
],
|
||||
"Taupo & Greater Area": [
|
||||
|
||||
],
|
||||
"Hawkes Bay": [
|
||||
|
||||
],
|
||||
"Mount Taranaki": [
|
||||
|
||||
],
|
||||
"Palmerston North & Whanganui": [
|
||||
|
||||
],
|
||||
"Mount Ruapehu": [
|
||||
|
||||
],
|
||||
"Wellington (Ashurst & South)": [
|
||||
|
||||
],
|
||||
"Christchurch & Kaikoura incl. Banks Peninsula": [
|
||||
|
||||
],
|
||||
"Southland (Otago, Invicargil Milford Sound etc)": [
|
||||
|
||||
],
|
||||
"Stewart Island, Snares Island & Antartica": [
|
||||
|
||||
],
|
||||
"Southern Alps / Alpine Fault": [
|
||||
|
||||
],
|
||||
"Queenstown & Wanaka": [
|
||||
|
||||
],
|
||||
}
|
251
config/stations_config.py
Normal file
251
config/stations_config.py
Normal file
@@ -0,0 +1,251 @@
|
||||
"""
|
||||
THIS IS A DICTIONARY that maps a sensot type to a list of available channels for that type
|
||||
"""
|
||||
SENSOR_TYPE_CHANNELS = {
|
||||
"Broadband": ["BHZ", "BHN", "BHE", "HHZ", "HHN", "HHE", "LHZ", "LHN", "LHE"],
|
||||
"Short Period": ["EHZ", "EHN", "EHE", "SHZ", "SHN", "SHE"],
|
||||
"Strong Motion": ["HNZ", "HNN", "HNE"],
|
||||
"All Channels": []
|
||||
}
|
||||
|
||||
#List of all known stations with their details
|
||||
# Each Station is a DICTIONARY
|
||||
ALL_STATIONS_CONFIG = [
|
||||
{
|
||||
"code": "RIZ",
|
||||
"name": "Bells Beach, Raoul Is.",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["Raoul Island", "Bells Beach" "Hikaurangi Trench"]
|
||||
},
|
||||
{
|
||||
"code": "GLKZ",
|
||||
"name": "Green Lake, Raoul Is.",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["Raoul Island", "Green Lake", "Hikaurangi Trench"]
|
||||
},
|
||||
{
|
||||
"code": "MXZ",
|
||||
"name": "Te Araroa",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["East Coast", "Te Araroa", "North Island", "Hikaurangi Trench"]
|
||||
},
|
||||
{
|
||||
"code": "WMGZ",
|
||||
"name": "Ruatoria",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["East Coast", "Ruatoria", "North Island", "Hikaurangi Trench"]
|
||||
},
|
||||
{
|
||||
"code": "PUZ",
|
||||
"name": "Tokomaru Bay",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["East Coast", "Tokomaru Bay", "North Island", "Hikaurangi Trench"]
|
||||
},
|
||||
{
|
||||
"code": "CNGZ",
|
||||
"name": "Tologa Bay",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Shot Period"],
|
||||
"area_tags": ["East Coast", "Tologa Bay", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "RIGZ",
|
||||
"name": "Gisborne",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["Gisborne", "East Coast", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "PRGZ",
|
||||
"name": "Tikiwhata",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["East Coast", "Tikiwhata", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "KNZ",
|
||||
"name": "Wairoa",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["Wairoa", "East Coast", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "WHHZ",
|
||||
"name": "Waihua",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["Waihua", "East Coast", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "ARHZ",
|
||||
"name": "Aropaonui",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["East Coast", "Aropaonui", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "CKHZ",
|
||||
"name": "Cape Kidnappers",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["Cape Kidnappers", "East Coast", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "KAHZ",
|
||||
"name": "Tukituki",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["Tukituki", "East Coast", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "PXZ",
|
||||
"name": "Pawanui",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["Pawanui", "East Coast", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "PRHZ",
|
||||
"name": "Porangahau",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["Porangahau", "East Coast", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "BFZ",
|
||||
"name": "Birch Farm",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["Birch Farm", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "CPWZ",
|
||||
"name": "Castlepoint",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["Castlepoint", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "TMWZ",
|
||||
"name": "Traveller",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["Traveller", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "WRRZ",
|
||||
"name": "White Rock",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["White Rock", "Hikaurangi Trench", "North Island"]
|
||||
},
|
||||
{
|
||||
"code": "CMWZ",
|
||||
"name": "Cape Campbell",
|
||||
"location_codes": {
|
||||
"EH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Short Period"],
|
||||
"area_tags": ["Cape Campbell", "North Island" "Hikaurangi Trench"]
|
||||
},
|
||||
{
|
||||
"code": "BSWZ",
|
||||
"name": "Black Birch Station",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["Black Birch Station", "South Island" "Hikaurangi Trench"]
|
||||
},
|
||||
{
|
||||
"code": "CTZ",
|
||||
"name": "Chatham Islands",
|
||||
"location_codes": {
|
||||
"HH": "10",
|
||||
"LH": "10",
|
||||
"default": "10"
|
||||
},
|
||||
"types": ["Broadband"],
|
||||
"area_tags": ["Chatham Islands", "Hikaurangi Trench"]
|
||||
},
|
||||
]
|
||||
|
||||
# Post processing for convenience
|
||||
ALL_UNIQUE_CHANNELS = sorted(list(set(sum(SENSOR_TYPE_CHANNELS.values(), []))))
|
||||
SENSOR_TYPE_CHANNELS["All Channels"] = ALL_UNIQUE_CHANNELS
|
||||
|
||||
# Pre built dictionary for quick lookup by station code
|
||||
STATION_LOOKUP = {station['code']: station for station in ALL_STATIONS_CONFIG}
|
Reference in New Issue
Block a user