def __init__(self, temp, cnc, cnc_igl): """ Constructor """ self.__temp = Datum.float(temp, 1) # temperature °C self.__cnc = Datum.float(cnc, 1) # concentration ppm self.__cnc_igl = Datum.float(cnc_igl, 1) # concentration (ideal gas law corrected) ppm
def __init__(self, ref, act, therm): """ Constructor """ self.__ref = Datum.float(ref, 6) # pile_ref_amplitude Volts self.__act = Datum.float(act, 6) # pile_act_amplitude Volts self.__therm = Datum.float(therm, 6) # thermistor_average Volts
def __init__(self, parameter, parameter_code, method_code, recording_mode, collection_description, analysis_description, method_type, reference_method_id, equivalent_method, federal_mdl, min_value, max_value, digits, round_truncate_indicator, units): """ Constructor """ self.__parameter = parameter # string self.__parameter_code = int(parameter_code) # int(5) self.__method_code = int(method_code) # int(3) self.__recording_mode = recording_mode # string self.__collection_description = collection_description # string self.__analysis_description = analysis_description # string self.__method_type = method_type # string self.__reference_method_id = reference_method_id # string self.__equivalent_method = equivalent_method # string self.__federal_mdl = Datum.float(federal_mdl) # float self.__min_value = Datum.float(min_value) # float self.__max_value = Datum.float(max_value) # float self.__digits = Datum.int(digits) # int self.__round_truncate_indicator = round_truncate_indicator # string self.__units = units # string
def __init__(self, humid, temp, press): """ Constructor """ self.__humid = Datum.float(humid, 1) # float % self.__temp = Datum.float(temp, 1) # float °C self.__press = Datum.float(press, 1) # float kPa
def __init__(self, pm1, pm2p5, pm10): """ Constructor """ self.__pm1 = Datum.float(pm1, 1) # PM1 self.__pm2p5 = Datum.float(pm2p5, 1) # PM2.5 self.__pm10 = Datum.float(pm10, 1) # PM10
def __init__(self, pile_ref_ampl, pile_act_ampl, thermistor_avg): """ Constructor """ self.__pile_ref_ampl = Datum.float(pile_ref_ampl, 6) self.__pile_act_ampl = Datum.float(pile_act_ampl, 6) self.__thermistor_avg = Datum.float(thermistor_avg, 6)
def __init__(self, av1, av5, av15): """ Constructor """ self.__av1 = Datum.float(av1, 2) # one-minute load average self.__av5 = Datum.float(av5, 2) # five-minute load average self.__av15 = Datum.float(av15, 2) # 15-minute load average
def __init__(self, name, interval, tally): """ Constructor """ self.__name = name self.__interval = Datum.float(interval, 1) # time between samples self.__tally = Datum.int(tally) # number of samples per report
def __init__(self, ndir_serial, board_serial, selected_range, lamp_voltage, lamp_period, sample_start, sample_end, range_iaq, range_safety, range_combustion, range_industrial, range_custom): """ Constructor """ super().__init__() # identity... self.__ndir_serial = ndir_serial # unsigned long self.__board_serial = board_serial # unsigned long self.__selected_range = Datum.int(selected_range) # common fields... self.__lamp_voltage = Datum.float(lamp_voltage, 1) self.__lamp_period = Datum.int(lamp_period) self.__sample_start = Datum.int(sample_start) self.__sample_end = Datum.int(sample_end) # range calibrations... self.__range_iaq = range_iaq self.__range_safety = range_safety self.__range_combustion = range_combustion self.__range_industrial = range_industrial self.__range_custom = range_custom
def construct_from_jdict(cls, jdict): if not jdict: return None serial_number = jdict.get('serial_number') afe_type = jdict.get('type') calibrated_on = Datum.date(jdict.get('calibrated_on')) dispatched_on = Datum.date(jdict.get('dispatched_on')) pt1000_v20 = jdict.get('pt1000_v20') pt100_calib = Pt1000Calib(calibrated_on, pt1000_v20) if pt1000_v20 is not None else None sensor_calibs = [] for key in sorted(jdict.keys()): if key[:2] == "sn": if jdict[key] is None: sensor_calibs.append(None) continue sensor_type = jdict[key]['sensor_type'] if sensor_type[-2:] == 'A4' or sensor_type[:2] == 'SN': sensor_calibs.append(A4Calib.construct_from_jdict(jdict[key])) elif sensor_type[:3] == 'PID': sensor_calibs.append(PIDCalib.construct_from_jdict(jdict[key])) return AFECalib(serial_number, afe_type, calibrated_on, dispatched_on, pt100_calib, sensor_calibs)
def construct_from_jdict(cls, jdict): if not jdict: return None serial_number = jdict.get('serial_number') afe_type = jdict.get('type') calibrated_on = Datum.date(jdict.get('calibrated_on')) dispatched_on = Datum.date(jdict.get('dispatched_on')) pt1000_v20 = jdict.get('pt1000_v20') pt100_calib = None if pt1000_v20 is None else Pt1000Calib( calibrated_on, pt1000_v20) sensor_calibs = [] for key in sorted(jdict.keys()): if key[:2] == "sn": if jdict[key] is None: sensor_calibs.append(None) continue sensor_calibs.append( SensorCalib.construct_from_jdict(jdict[key])) return AFECalib(serial_number, afe_type, calibrated_on, dispatched_on, pt100_calib, sensor_calibs)
def __init__(self, name=None, zigbee_channel=None, dhcp=None, ip_address=None, netmask=None, gateway=None, proxy_address=None, proxy_port=None, utc=None, timezone=None, sw_update=None, link_button=None, portal_services=None): """ Constructor """ self.__name = name # string self.__zigbee_channel = Datum.int(zigbee_channel) # int self.__dhcp = Datum.bool(dhcp) # bool self.__ip_address = ip_address # string self.__netmask = netmask # string self.__gateway = gateway # string self.__proxy_address = proxy_address # string self.__proxy_port = Datum.int(proxy_port) # int self.__utc = utc # string (date / time) self.__timezone = timezone # string (timezone ID) self.__sw_update = sw_update # SWUpdate self.__link_button = Datum.bool(link_button) # bool self.__portal_services = Datum.bool(portal_services) # bool
def __init__(self, rec, pile_ref, pile_act): """ Constructor """ self.__rec = Datum.int(rec) self.__pile_ref = Datum.int(pile_ref) self.__pile_act = Datum.int(pile_act)
def __init__(self, serial_number, sensor_type, pid_elc_mv, pid_sens_mv): """ Constructor """ SensorCalib.__init__(self, serial_number, sensor_type) self.__pid_elc_mv = Datum.int(pid_elc_mv) # PID electronic zero mV self.__pid_sens_mv = Datum.float(pid_sens_mv, 6) # PID sensitivity mV / ppm
def __init__(self, pos, elv, quality): """ Constructor """ self.__pos = pos # Position self.__elv = Datum.float(elv, 1) # metres above mean sea level self.__quality = Datum.int(quality) # 0 to 6 (?)
def __init__(self, rec, pm1, pm2p5, pm10): """ Constructor """ self.__rec = rec # LocalizedDatetime self.__pm1 = Datum.float(pm1, 1) # PM1 self.__pm2p5 = Datum.float(pm2p5, 1) # PM2.5 self.__pm10 = Datum.float(pm10, 1) # PM10
def __init__(self, actual_press, sl_press, t_adc, temp): """ Constructor """ self.__actual_press = Datum.float(actual_press, 1) # kPa self.__sl_press = Datum.float(sl_press, 1) # kPa self.__t_adc = Datum.int(t_adc) # T adc count self.__temp = Datum.float(temp, 1) # °C
def __init__(self, we_v, ae_v, we_c=None, cnc=None): """ Constructor """ self.__we_v = Datum.float(we_v, 6) # uncorrected working electrode voltage Volts self.__ae_v = Datum.float(ae_v, 6) # uncorrected auxiliary electrode voltage Volts self.__we_c = Datum.float(we_c, 6) # corrected working electrode voltage Volts self.__cnc = Datum.float(cnc, 1) # gas concentration ppb
def __init__(self, name, response_time, execution_time, return_count): """ Constructor """ self.__name = name # 2 char string self.__response_time = Datum.float(response_time, 3) # float Seconds self.__execution_time = Datum.float(execution_time, 3) # float Seconds self.__return_count = Datum.int(return_count) # int or None
def __init__(self, rec, pile_ref, pile_act, thermistor): """ Constructor """ self.__rec = rec self.__pile_ref = Datum.float(pile_ref, 4) self.__pile_act = Datum.float(pile_act, 4) self.__thermistor = Datum.float(thermistor, 4)
def __init__(self, standby, charger_status, v_in, charge_status, prot_batt): """ Constructor """ self.__standby = standby # bool self.__charger_status = charger_status # ChargerStatus self.__v_in = Datum.float(v_in, 1) # PSU input voltage float self.__charge_status = charge_status # ChargeStatus self.__prot_batt = Datum.float(prot_batt, 1) # battery voltage float
def __init__(self, temp, voltage, cnc, cnc_igl): """ Constructor """ self.__temp = Datum.float( temp, 1) # temperature ºC self.__voltage = Datum.int( voltage) # voltage mV self.__cnc = Datum.float( cnc, 1) # concentration ppm self.__cnc_igl = Datum.float( cnc_igl, 1) # concentration (ideal gas law corrected) ppm
def __init__(self, path_name, domain_min, domain_max, brightness, transition_time): """ Constructor """ super().__init__() self.__path_name = path_name # string self.__domain_min = domain_min # float self.__domain_max = domain_max # float self.__brightness = Datum.int(brightness) # int self.__transition_time = Datum.int(transition_time) # int
def construct_from_jdict(cls, jdict): if not jdict: return SensorBaseline(None, 0) if 'calibrated_on' in jdict: # TODO: deprecated date = Datum.date(jdict.get('calibrated_on')) calibrated_on = LocalizedDatetime.construct_from_date(date) else: calibrated_on = Datum.datetime(jdict.get('calibrated-on')) offset = Datum.int(jdict.get('offset')) return SensorBaseline(calibrated_on, offset)
def __init__(self, rec, pm1, pm2p5, pm10, period, bins, bin_1_mtof, bin_3_mtof, bin_5_mtof, bin_7_mtof): """ Constructor """ PMxDatum.__init__(self, rec, pm1, pm2p5, pm10) self.__period = Datum.float(period, 1) # seconds self.__bins = [int(count) for count in bins] # array of count self.__bin_1_mtof = Datum.int(bin_1_mtof) # time self.__bin_3_mtof = Datum.int(bin_3_mtof) # time self.__bin_5_mtof = Datum.int(bin_5_mtof) # time self.__bin_7_mtof = Datum.int(bin_7_mtof) # time
def construct_from_jdict(cls, jdict): if not jdict: return None if 'calibrated_on' in jdict: # TODO: deprecated date = Datum.date(jdict.get('calibrated_on')) calibrated_on = LocalizedDatetime.construct_from_date(date) else: calibrated_on = Datum.datetime(jdict.get('calibrated-on')) v20 = jdict.get('v20') return Pt1000Calib(calibrated_on, v20)
def __init__(self, charge, tte, ttf): """ Constructor """ self.__charge = Datum.int(charge) # int percentage self.__tte = tte # TimeDelta time to empty self.__ttf = ttf # TimeDelta time to full
def __init__(self, topic, species, source, parameter_code, unit_code, qc_code, method_code, mpc_code, mpc_value): """ Constructor """ self.__topic = topic # string self.__species = species # string self.__source = source # string self.__parameter_code = parameter_code # int(5) or string self.__unit_code = Datum.int(unit_code) # int(3) self.__qc_code = Datum.int(qc_code) # int self.__method_code = Datum.int(method_code) # int(3) self.__mpc_code = Datum.int(mpc_code) # int self.__mpc_value = Datum.float(mpc_value, 5) # numeric(10,5)
def __init__(self, power_reset, watchdog_reset, battery_fault, host_3v3, v_in, prot_batt): """ Constructor """ self.__power_reset = power_reset # restart because host was powered down bool self.__watchdog_reset = watchdog_reset # restart because of watchdog timeout bool self.__battery_fault = battery_fault # battery fault bool self.__host_3v3 = Datum.float( host_3v3, 1) # host 3V3 voltage float self.__v_in = Datum.float( v_in, 1) # PSU input voltage float self.__prot_batt = Datum.float( prot_batt, 1) # battery voltage float
def construct_from_jdict(cls, jdict): if not jdict: return TimezoneConf(None, None) set_on = Datum.datetime(jdict.get('set-on')) name = jdict.get('name') return TimezoneConf(set_on, name)