예제 #1
0
    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
예제 #2
0
    def __init__(self,
                 source,
                 rec,
                 pm1,
                 pm2p5,
                 pm10,
                 period,
                 bins,
                 bin_1_mtof,
                 bin_3_mtof,
                 bin_5_mtof,
                 bin_7_mtof,
                 sfr=None,
                 sht=None):
        """
        Constructor
        """
        PMxDatum.__init__(self, rec, pm1, pm2p5, None, pm10)

        self.__source = source  # string

        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)  # float time
        self.__bin_3_mtof = Datum.int(bin_3_mtof)  # float time
        self.__bin_5_mtof = Datum.int(bin_5_mtof)  # float time
        self.__bin_7_mtof = Datum.int(bin_7_mtof)  # float time

        self.__sfr = Datum.float(sfr, 3)  # float sample flow rate

        self.__sht = sht  # SHTDatum
    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)
예제 #5
0
    def __init__(self,
                 site_code=None,
                 data_status=None,
                 action_code=None,
                 datetime_code=None,
                 parameter_code=None,
                 duration=None,
                 frequency=None,
                 value=None,
                 unit_code=None,
                 qc_code=None,
                 poc=None,
                 lat=None,
                 lon=None,
                 gis_datum=None,
                 elev=None,
                 method_code=None,
                 mpc_code=None,
                 mpc_value=None,
                 uncertainty=None,
                 qualifiers=None):
        """
        Constructor
        """
        self.__site_code = str(site_code)  # nvarchar(12)      required
        self.__data_status = Datum.int(
            data_status)  # int(1)            required

        self.__action_code = Datum.int(action_code)  # int(1)

        self.__datetime_code = str(datetime_code)  # nvarchar(20)      required
        self.__parameter_code = parameter_code  # int(5) or string  required
        self.__duration = Datum.int(duration)  # int               required

        self.__frequency = Datum.int(frequency)  # int

        self.__value = Datum.float(value, 5)  # numeric(10,5)     required
        self.__unit_code = Datum.int(unit_code)  # int(3)            required
        self.__qc_code = Datum.int(qc_code)  # int               required
        self.__poc = Datum.int(poc)  # int               required

        self.__lat = Datum.float(lat, 6)  # numeric(10,6)
        self.__lon = Datum.float(lon, 6)  # numeric(10,6)
        self.__gis_datum = gis_datum  # nvarchar(10)
        self.__elev = Datum.int(elev)  # 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)
        self.__uncertainty = Datum.float(uncertainty, 5)  # numeric(10,5)
        self.__qualifiers = qualifiers  # nvarchar(255)
    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
예제 #7
0
    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
예제 #8
0
 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
예제 #9
0
파일: method.py 프로젝트: seoss/scs_core
    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
예제 #10
0
    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)
예제 #11
0
 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
예제 #12
0
    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
예제 #13
0
파일: gps_datum.py 프로젝트: seoss/scs_core
    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 (?)
예제 #14
0
 def __init__(self, des_cap, sense_res, chrg_term, empty_v_target,
              recovery_v, chrg_v, batt_type):
     """
     Constructor
     """
     self.__des_cap = Datum.int(
         des_cap)  # designed capacity of the battery (mAh)
     self.__sense_res = Datum.float(sense_res,
                                    3)  # size of the sense resistor (Ω)
     self.__chrg_term = Datum.int(
         chrg_term)  # battery’s termination charge (mA)
     self.__empty_v_target = Datum.float(
         empty_v_target, 2)  # empty target voltage (V, resolution is 10mV)
     self.__recovery_v = Datum.float(recovery_v, 2)  # recovery voltage (V)
     self.__chrg_v = Datum.int(chrg_v)  # charge voltage (see constants)
     self.__batt_type = Datum.int(
         batt_type)  # type of battery (see constants)
예제 #15
0
    def __init__(self, calibrated_on, offset, environment):
        """
        Constructor
        """
        self.__calibrated_on = calibrated_on            # LocalizedDatetime

        self.__offset = Datum.int(offset)               # int                       ppb
        self.__environment = environment                # BaselineEnvironment
예제 #16
0
    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
예제 #17
0
    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
예제 #18
0
    def __init__(self, input_power_present, charge, tte, ttf, v, current,
                 temperature, capacity, cycles):
        """
        Constructor
        """
        self.__input_power_present = input_power_present  # bool

        self.__charge = charge  # ChargeLevel

        self.__tte = tte  # TimeDelta     time to empty
        self.__ttf = ttf  # TimeDelta     time to full

        self.__v = Datum.float(v)  # float         voltage
        self.__current = Datum.int(current)  # int           current (mA)
        self.__temperature = Datum.float(temperature,
                                         1)  # float         temperature (°C)

        self.__capacity = Datum.int(capacity)  # int           mAh
        self.__cycles = Datum.float(cycles, 1)  # float         percentage
예제 #19
0
 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
예제 #20
0
파일: a4_calib.py 프로젝트: seoss/scs_core
    def __init__(self, serial_number, sensor_type, we_elc_mv, we_cal_mv,
                 we_tot_mv, ae_elc_mv, ae_cal_mv, ae_tot_mv, we_sens_na,
                 we_x_sens_na, pcb_gain, we_sens_mv, we_no2_x_sens_mv):
        """
        Constructor
        """
        SensorCalib.__init__(self, serial_number, sensor_type)

        self.__we_elc_mv = Datum.int(
            we_elc_mv)  # WE electronic zero                    mV
        self.__we_cal_mv = Datum.int(
            we_cal_mv)  # WE sensor zero at 23 °C               mV
        self.__we_tot_mv = Datum.int(
            we_tot_mv)  # total WE zero                         mV

        self.__ae_elc_mv = Datum.int(
            ae_elc_mv)  # Aux electronic zero                   mV
        self.__ae_cal_mv = Datum.int(
            ae_cal_mv)  # Aux sensor zero at 23 °C              mV
        self.__ae_tot_mv = Datum.int(
            ae_tot_mv)  # total Aux zero                        mV

        self.__we_sens_na = Datum.float(
            we_sens_na, 3)  # WE sensitivity                        nA
        self.__we_x_sens_na = Datum.float(
            we_x_sens_na, 3)  # WE cross-sensitivity                  nA

        self.__pcb_gain = Datum.float(
            pcb_gain, 3)  # PCB gain                              mv / nA

        self.__we_sens_mv = Datum.float(
            we_sens_mv, 3)  # WE sensitivity                        mV / ppb
        self.__we_no2_x_sens_mv = Datum.float(
            we_no2_x_sens_mv,
            3)  # WE cross-sensitivity                  mV / ppb
예제 #21
0
    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)
예제 #22
0
    def __init__(self, calibrated_on, r_comp_0, temp_co, full_cap_rep,
                 full_cap_nom, cycles):
        """
        Constructor
        """
        super().__init__()

        self.__calibrated_on = calibrated_on  # unsigned int

        self.__r_comp_0 = r_comp_0  # unsigned int
        self.__temp_co = temp_co  # unsigned int
        self.__full_cap_rep = full_cap_rep  # unsigned int
        self.__full_cap_nom = full_cap_nom  # unsigned int

        self.__cycles = Datum.int(cycles)  # unsigned int
    def __init__(self,
                 update_state=None,
                 check_for_update=None,
                 device_types=None,
                 url=None,
                 text=None,
                 notify=None):
        """
        Constructor
        """
        self.__update_state = Datum.int(update_state)  # int
        self.__check_for_update = Datum.bool(check_for_update)  # bool
        self.__device_types = device_types  # DeviceTypes

        self.__url = url  # string

        self.__text = text  # string
        self.__notify = Datum.bool(notify)  # bool
예제 #24
0
 def __init__(self, seconds):
     """
     Constructor
     """
     self.__seconds = Datum.int(seconds)
예제 #25
0
 def __init__(self, percent, mah):
     """
     Constructor
     """
     self.__percent = Datum.float(percent, 1)  # float         percentage
     self.__mah = Datum.int(mah)  # int           mAh
예제 #26
0
 def __init__(self, calibrated_on, c25):
     """
     Constructor
     """
     self.__calibrated_on = calibrated_on  # LocalizedDatetime
     self.__c25 = Datum.int(c25)  # T adc count at 25 °C