teksi / wastewater

[DEV] Future TEKSI wastewater module, adapted data model to fit VSA-DSS 2020 new standard
https://teksi.github.io/wastewater
GNU General Public License v3.0
0 stars 5 forks source link

Add button update wastewater symbologies and labels #264

Open sjib opened 2 months ago

sjib commented 2 months ago
          These 2 lines did run obviously with the import 

SELECT tww_app.wastewater_structure_update_fk_main_cover('', True); SELECT tww_app.wastewater_structure_update_fk_main_wastewater_node('', True);

These 3 lines did not run, but must run with the import: SELECT tww_app.update_wastewater_node_symbology(NULL, True); SELECT tww_app.update_wastewater_structure_label(NULL, True); SELECT tww_app.update_wn_symbology_by_overflow(NULL, True);

And additionally: the user should be able to manualy run this lines whenever he wants. -> a new button or command in the ui to start this functions.

Originally posted by @urskaufmann in https://github.com/teksi/wastewater/issues/260#issuecomment-2179955159

sjib commented 2 months ago

Add code for new button to https://github.com/teksi/wastewater/blob/6b2ce4bda2b9f888241bf79f7f1c162e29b2a96b/plugin/teksi_wastewater/teksi_wastewater_plugin.py#L146

and define new tool twwupdatewwssymbology.py in \wastewater\plugin\teksi_wastewater\tools

sjib commented 2 months ago

At all - are there any other requests for new buttons? Then please link to this issue.

sjib commented 2 months ago

These 3 lines did not run, but must run with the import: SELECT tww_app.update_wastewater_node_symbology(NULL, True); SELECT tww_app.update_wastewater_structure_label(NULL, True); SELECT tww_app.update_wn_symbology_by_overflow(NULL, True);

Already added to import process - see https://github.com/teksi/wastewater/pull/263

MIght have to be re-coded if new buttons exist.

domi4484 commented 1 month ago

@sjib SELECT tww_app.update_wn_symbology_by_overflow(NULL, True); this is already done inside update_wastewater_node_symbology. Is still needed to exec it again after update_wastewater_structure_label?

sjib commented 1 month ago

@domi4484 The idea is to create a new button "update wastewater symbologies and labels" in the plugin to be able to run these queries not only during the import process but anytime you want to update the symbology (as we can requery the network topology):

SELECT tww_app.update_wastewater_node_symbology(NULL, True);
SELECT tww_app.update_wastewater_structure_label(NULL, True);
SELECT tww_app.update_wn_symbology_by_overflow(NULL, True);

To all: Please vote with thumbs up if you think such a button is a necessary enhancement. Vote with thumb down if you think it is not necessary.

domi4484 commented 1 month ago

@sjib in the upper comment I meant that update_wn_symbology_by_overflow is already executed inside update_wastewater_node_symbology at this line: https://github.com/teksi/wastewater/blob/e7f1ca2db2402afdbe5feec9314ace42cf3116a7/datamodel/app/symbology_functions.sql#L66

It means the new button should execute only those queries i guess:

SELECT tww_app.update_wastewater_node_symbology(NULL, True);
SELECT tww_app.update_wastewater_structure_label(NULL, True);