qwat-data-model icon indicating copy to clipboard operation
qwat-data-model copied to clipboard

Fix orientation of element part when updating pipe or element part

Open benoitblanc opened this issue 3 years ago • 2 comments

Description

When user wants to connect an element part to a pipe, orientation of the element is wrong, fixing angle to 0 or some wrong value.

Before

qwat

After

demo_qwat_fix_orientation

To do so, I fixed the node taken into account when updating pipe in trigger (NEW instead of OLD).

Then, for the element part update, I need to call a function in auto-generated trigger qwat_od.ft_element_part_update. So I have created a custom_update in ordinary_data/views/inheritance/od_all_inheritance.py and I wanted to handle it in ordinary_data/views/inheritance/pg_inheritance_view_recursive.py in sql_join_update_trigger method (as there is the same thing with custom_delete). But I have an error when I try to generate views :

/QWAT/data-model/ordinary_data/views/insert_views.sh: ligne 15: /usr/bin/psql: Liste d'arguments trop longue

So I am wondering how I can add an argument, something is missing but I can't find what... @3nids I need some help to understand how to add custom code in auto-generated triggers.

Thanks

benoitblanc avatar Dec 21 '21 08:12 benoitblanc

I am not sure for the custom function. Sylvain originally wrote the Python code, and I am not really familiar with the code.

It was the right way to add custom code in generated trigger, but I had two ;; generated. One in od_all_inheritance.py and one in fn_element_part_set_orientation.sql :facepalm:

benoitblanc avatar Jan 05 '22 15:01 benoitblanc

Since CI is functionnal again, I would try to get this fixed if possible.

@kandre can you follow this?

ponceta avatar Nov 18 '22 08:11 ponceta

@benoitblanc we need a delta and a test here, could you provide it?

Test should be based on similar testing from @sylvainbeo mentionned by @3nids

ponceta avatar Dec 19 '22 13:12 ponceta

@ponceta I have rebased this branch on master, added deltas and added one test to update orientation by moving a node of a pipe.

benoitblanc avatar Mar 02 '23 14:03 benoitblanc

Thank you @benoitblanc this is great!

ponceta avatar Mar 07 '23 10:03 ponceta