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')
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([])
def get_nrl_instrument(instrument_type: str, manufactory: str): instruments = EquipmentModel.get_instruments_nrl(instrument_type, manufactory) return response.string_to_response(instruments)
def get_nrl_manufacturers(instrument_type: str): manufactures = EquipmentModel.get_all_manufactures_nrl(instrument_type) return response.string_to_response(manufactures)
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)
def get_gains(manufactory: str, instrument: str): gains = EquipmentModel.get_gain_from_nrl(manufactory, instrument) return response.string_to_response(gains)
def get_sensor_extra_info(manufactory: str, instrument: str): sr = EquipmentModel.get_sensor_extra_information(manufactory, instrument) return response.string_to_response(sr)