# Path: ish_parser/Pressure.py
# class Pressure(Observation):
#   ''' Pressure is .. well.. pressure '''
#   HECTOPASCALS = 1
#   MISSING = [99999, 9999.9]
# 
#   def __eq__(self, other_value):
#     if int(self._obs_value) == int(other_value):
#       return True
#     else:
#       return False
# 
#   def __str__(self):
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return str(self._obs_value)
# 
#   def get_inches(self):
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return round(self._obs_value * 0.02953, 2)
# 
# Path: ish_parser/Components/BaseComponent.py
# class BaseComponent(object):
#   ''' base component handler '''


from ..Pressure import Pressure
from .BaseComponent import BaseComponent

class PressureComponent(BaseComponent):
  ''' handle MA1 pressure type '''

  def loads(self, string):
      self.pressure_observation = {
          'altimeter_setting': Pressure(int(string[0:5])/10.0, Pressure.HECTOPASCALS, string[5:6]),

# Path: ish_parser/Pressure.py
# class Pressure(Observation):
#   ''' Pressure is .. well.. pressure '''
#   HECTOPASCALS = 1
#   MISSING = [99999, 9999.9]
# 
#   def __eq__(self, other_value):
#     if int(self._obs_value) == int(other_value):
#       return True
#     else:
#       return False
# 
#   def __str__(self):
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return str(self._obs_value)
# 
#   def get_inches(self):
#     if self._obs_value in self.MISSING:
#       return 'MISSING'
#     else:
#       return round(self._obs_value * 0.02953, 2)
# 
# Path: ish_parser/Components/BaseComponent.py
# class BaseComponent(object):
#   ''' base component handler '''


# Path: ish_parser/Components/PressureComponent.py
from ..Pressure import Pressure
from .BaseComponent import BaseComponent


class PressureComponent(BaseComponent):
  ''' handle MA1 pressure type '''

  def loads(self, string):
      self.pressure_observation = {
          'altimeter_setting': Pressure(int(string[0:5])/10.0, Pressure.HECTOPASCALS, string[5:6]),

          'station_pressure': Pressure(int(string[6:11]) / 10.0, Pressure.HECTOPASCALS, string[11:12]),