Skip to content

Qgis selector button

Edgar Fuste edited this page Nov 2, 2021 · 1 revision

The selector tool groups in a single button different filters that can be applied to the visualization of the network. It allows to filter data by:

  • Exploitation
  • Network state (OBSOLETE, ON SERVICE, PLANNED)
  • Customer state (hydrometer tables)
  • Existing planning sectors
  • Hydraulic Sectors (to send them or not to the generation of the hydraulic model)


Selector may be modified using config_param_system table by changing json values for the listed parameters:

Selector Parameter Default values
Exploitation basic_selector_explfrommuni {"selector":"selector_expl", "selector_id":"expl_id"}
Exploitation basic_selector_tab_exploitation {"table":"exploitation", "selector":"selector_expl", "table_id":"expl_id", "selector_id":"expl_id", "label":"expl_id, ' - ', name", "orderBy":"expl_id", "manageAll":true, "selectionMode":"keepPreviousUsingShift" , "query_filter":"AND expl_id > 0", "typeaheadFilter":" AND lower(concat(expl_id, ' - ', name))"}
Hydrometer basic_selector_tab_hydro_state {"table":"ext_rtc_hydrometer_state", "selector":"selector_hydrometer", "table_id":"id", "selector_id":"state_id", "label":"id, ' - ', name", "manageAll":true, "query_filter":""}
Mincut basic_selector_tab_mincut {"table":"om_mincut", "table_id":"id", "selector":"selector_mincut_result", "selector_id":"result_id", "label":"id, '(', CASE WHEN work_order IS NULL THEN 'N/I' ELSE work_order END, ') on ', forecast_start::date, ' at ', forecast_start::time, 'H-', forecast_end::time,'H'", "query_filter":" AND id > 0 "}
State basic_selector_tab_network_state {"table":"ext_rtc_hydrometer_state", "selector":"selector_hydrometer", "table_id":"id", "selector_id":"state_id", "label":"id, ' - ', name", "manageAll":true, "query_filter":""}
Psector basic_selector_tab_psector {"table":"plan_psector", "selector":"selector_psector", "table_id":"psector_id", "selector_id":"psector_id", "label":"psector_id, ' - ', name", "orderBy":"psector_id","manageAll":true, "query_filter":" AND expl_id IN (SELECT expl_id FROM selector_expl WHERE cur_user = current_user)", "layermanager":{"active":"v_edit_psector", "visible":["v_edit_arc", "v_edit_node", "v_edit_connec", "v_edit_gully"], "addToc":["v_edit_psector"]}, "typeaheadFilter":" AND lower(concat(expl_id, ' - ', name))"}
Sector basic_selector_tab_sector {"table":"sector", "selector":"selector_sector", "table_id":"sector_id", "selector_id":"sector_id", "label":"sector_id, ' - ', name", "orderBy":"sector_id","manageAll":true, "query_filter":" AND sector_id > 0"}

Json key explanation:

Key Description Example
table Table, that has all values by which data will be filtered "table":"exploitation"
table_id Id of filter table "table_id":"expl_id"
selector Name of selector table, where current filter value is stored "selector":"selector_expl"
selector_id Id of selector "selector_id":"expl_id"
label Text showed to the user on selector form. May be one field name or concatenation of fields "label":"expl_id, ' - ', name"
orderBy Field that orders list of options on the form "orderBy":"expl_id"
manageAll If true, an extra check Check all is added on the form "manageAll":true"
query_filter Filter for options showed on selector form "AND expl_id > 0"
selectionMode Defines the way of selecting various checks on selector. If key doesn't exist each click on checkbox adds value on selector "selectionMode":"keepPreviousUsingShift"
typeaheadFilter If key exists, an extra typeahead filter is added on the form, which allows filtering selector options by query " AND lower(concat(expl_id, ' - ', name))"
layermanager In case when selector activates a layer from ToC, the value defines active and visible layers, and in case that layer is not present on the ToC adds it from the database {"active":"v_edit_psector", "visible":["v_edit_arc", "v_edit_node", "v_edit_connec", "v_edit_gully"], "addToc":["v_edit_psector"]}
Clone this wiki locally