Exemplo n.º 1
0
def rename_files(channel_id):
    progress_id = 'rename_' + channel_id
    with ProgressEvent(progress_id) as pe:
        ch: ChannelModel = ChannelModel.find_by_id(channel_id)
        if not ch:
            raise EntityNotFound(
                "The channel with id {} doesn't exist".format(channel_id))
        ch.rename_data(pe)

    return response.string_to_response('Ok')
Exemplo n.º 2
0
def get_rights_from_roles(role_id: str):
    right_ids: List[str] = RolesRightsModel.get_rights_by_role(role_id)
    if right_ids:
        return response.string_to_response(right_ids)

    return response.string_to_response([])
Exemplo n.º 3
0
def get_nrl_instrument(instrument_type: str, manufactory: str):
    instruments = EquipmentModel.get_instruments_nrl(instrument_type,
                                                     manufactory)
    return response.string_to_response(instruments)
Exemplo n.º 4
0
def get_nrl_manufacturers(instrument_type: str):
    manufactures = EquipmentModel.get_all_manufactures_nrl(instrument_type)
    return response.string_to_response(manufactures)
Exemplo n.º 5
0
def get_sample_rates(manufactory: str, instrument: str, gain: str):
    sr = EquipmentModel.get_sample_rate_from_nrl(manufactory, instrument, gain)
    return response.string_to_response(sr)
Exemplo n.º 6
0
def get_gains(manufactory: str, instrument: str):
    gains = EquipmentModel.get_gain_from_nrl(manufactory, instrument)
    return response.string_to_response(gains)
Exemplo n.º 7
0
def get_sensor_extra_info(manufactory: str, instrument: str):
    sr = EquipmentModel.get_sensor_extra_information(manufactory, instrument)
    return response.string_to_response(sr)