Example #1
0
def find_total_flow_int_field():

    key_name = 'field_flow_total_int'
    if cache.is_exists(key_name):
        return cache.get_obj(key_name, DataField)

    field = core.find_one_data_field({'field_name': 'flow_total_int'})
    cache.set_obj(key_name, field)

    return field
Example #2
0
def find_surplus_gas_field():

    key_name = 'field_surplus_gas'
    if cache.is_exists(key_name):
        return cache.get_obj(key_name, DataField)

    field = core.find_one_data_field({'field_name': 'surplus_gas'})
    cache.set_obj(key_name, field)

    return field
Example #3
0
def find_temperature_field():

    key_name = 'field_temperature'
    if cache.is_exists(key_name):
        return cache.get_obj(key_name, DataField)

    field = core.find_one_data_field({'field_name': 'temperature'})
    cache.set_obj(key_name, field)

    return field
Example #4
0
def find_power_field():

    key_name = 'field_power'
    if cache.is_exists(key_name):
        return cache.get_obj(key_name, DataField)

    field = core.find_one_data_field({'field_name': 'power'})
    cache.set_obj(key_name, field)

    return field
Example #5
0
def find_address_field():
    """
    查找地址数据域
    :return:
    """
    key_name = 'field_address'
    if cache.is_exists(key_name):
        return cache.get_obj(key_name, DataField)

    field = core.find_one_data_field({'field_name': 'address'})
    cache.set_obj(key_name, field)

    return field
Example #6
0
def find_opr_code_field():
    """
    查找操作码数据域
    :return:
    """
    key_name = 'field_opr_code'
    if cache.is_exists(key_name):
        return cache.get_obj(key_name, DataField)

    field = core.find_one_data_field({'field_name': 'opr_code'})
    cache.set_obj(key_name, field)

    return field