# Path: pymeteo/data/acars.py
# def getAvailableDatasets():
# def getDataSet(set):
# def getAirportByCode(airport_id):
# def processDataSet(data):
#         _T = nc["temperature"][:]


from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from pymeteo.data import acars
import pymeteo.cm1.PlotWidget as PW
import pymeteo.cm1.StatWidget as SW
        #TODO: size widgets initially. This doesnt work
        self.LVert_widget.resize(250,500)
        self.Hodograph.resize(250,250)
        self.SoundingInfo.resize(250,250)
        self.Sounding.resize(250,500)


        self.center()
        self.setWindowTitle('ACARS Profile Plotting Tool')

        self.show()
        self.Sounding.plot_sounding_axes()
        self.Hodograph.plot_hodograph_axes()
        self.SoundingInfo.calcStats()

        self.SoundingInfo.statsdone.connect(self.enableButton)

    def center(self):
        qr = self.frameGeometry()
        cp = QtWidgets.QDesktopWidget().availableGeometry().center()
        qr.moveCenter(cp)
        self.move(qr.topLeft())

    def profileDesc(self,profile):
        profileDir = "UP" if profile["flag"] == 1 else "DOWN"
        return "{0}: {1}({2}) {3}".format(profile["i"], profile["airport"], profileDir, profile["time"])

    def processDataset(self, acarsFile):
        print("[+] Getting Data")
        self.profiles.clear()

# Path: pymeteo/data/acars.py
# def getAvailableDatasets():
# def getDataSet(set):
# def getAirportByCode(airport_id):
# def processDataSet(data):
#         _T = nc["temperature"][:]


# Path: pymeteo/UI/acars.py
from PyQt5 import QtWidgets, QtGui, QtCore
from PyQt5.QtCore import pyqtSignal, pyqtSlot
from pymeteo.data import acars
import pymeteo.cm1.PlotWidget as PW
import pymeteo.cm1.StatWidget as SW

        #TODO: size widgets initially. This doesnt work
        self.LVert_widget.resize(250,500)
        self.Hodograph.resize(250,250)
        self.SoundingInfo.resize(250,250)
        self.Sounding.resize(250,500)


        self.center()
        self.setWindowTitle('ACARS Profile Plotting Tool')

        self.show()
        self.Sounding.plot_sounding_axes()
        self.Hodograph.plot_hodograph_axes()
        self.SoundingInfo.calcStats()

        self.SoundingInfo.statsdone.connect(self.enableButton)

    def center(self):
        qr = self.frameGeometry()
        cp = QtWidgets.QDesktopWidget().availableGeometry().center()
        qr.moveCenter(cp)
        self.move(qr.topLeft())

    def profileDesc(self,profile):
        profileDir = "UP" if profile["flag"] == 1 else "DOWN"
        return "{0}: {1}({2}) {3}".format(profile["i"], profile["airport"], profileDir, profile["time"])

    def processDataset(self, acarsFile):
        print("[+] Getting Data")
        self.profiles.clear()

        self.data = acars.processDataSet(acars.getDataSet(acarsFile)) 