Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- % Performs a DB query to retrieve the desired protocols
- retrieve_finders_data() ->
- % Retrieving model's fields edited for local date created_at and updated_at
- DbColumns = controller_helpers:db_local_created_updated_times(finder),
- {Where, Limit} =
- Finders = boss_db:find_by_sql(finder, "SELECT " ++ DbColumns ++
- " FROM " ++ ?DB_FINDERS_TABLE),
- prepare_finders_data_for_output(Finders).
- % Prepares the finders' data for output
- prepare_finders_data_for_output(Finders) ->
- [
- [
- {id, F:id()},
- {finder_type, F:finder_type()},
- {eye, F:eye()},
- {fixation_label, FixationLabel},
- {x_pix, F:x_pix()},
- {y_pix, F:y_pix()},
- {radius_pix, F:radius_pix()},
- {color, [
- {red, F:red()},
- {green, F:red()},
- {blue, F:red()}
- ]}
- ] || F <- Finders, FixationLabel = case boss_db:find(fixation_target, [{id, equals, F:fixation_target_id()}], [{limit, 1}]) of
- [FixationTarget] ->
- FixationTarget:label();
- _ ->
- default_finder_fixation_label()
- end].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement