Advertisement
Guest User

Untitled

a guest
Apr 29th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 1.17 KB | None | 0 0
  1. % Performs a DB query to retrieve the desired protocols
  2. retrieve_finders_data() ->
  3.   % Retrieving model's fields edited for local date created_at and updated_at
  4.   DbColumns = controller_helpers:db_local_created_updated_times(finder),
  5.   {Where, Limit} =  
  6.   Finders = boss_db:find_by_sql(finder, "SELECT " ++ DbColumns ++
  7.     " FROM " ++ ?DB_FINDERS_TABLE),
  8.  
  9.   prepare_finders_data_for_output(Finders).
  10.  
  11.  
  12. % Prepares the finders' data for output
  13. prepare_finders_data_for_output(Finders) ->
  14.     [  
  15.         [
  16.         {id,                  F:id()},
  17.         {finder_type,         F:finder_type()},
  18.         {eye,                 F:eye()},
  19.         {fixation_label,      FixationLabel},
  20.         {x_pix,               F:x_pix()},
  21.         {y_pix,               F:y_pix()},
  22.         {radius_pix,          F:radius_pix()},
  23.         {color, [
  24.             {red,             F:red()},
  25.             {green,           F:red()},
  26.             {blue,            F:red()}
  27.         ]}
  28.     ] || F <- Finders, FixationLabel = case boss_db:find(fixation_target, [{id, equals, F:fixation_target_id()}], [{limit, 1}]) of
  29.                 [FixationTarget] ->
  30.                     FixationTarget:label();
  31.                 _ ->
  32.                     default_finder_fixation_label()
  33.         end].
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement