Skip to content

Commit

Permalink
fix mirrors
Browse files Browse the repository at this point in the history
fix #133
  • Loading branch information
3nids committed Jan 30, 2024
1 parent 510e2f6 commit f5e80c6
Show file tree
Hide file tree
Showing 16 changed files with 493 additions and 164 deletions.
24 changes: 8 additions & 16 deletions data_model/app/vw_sign_symbol.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
WHEN sign.complex IS TRUE THEN 'complex.svg'::text
WHEN sign.fk_sign_type = 11 THEN vl_official_sign.img_de
WHEN sign.fk_sign_type = 12 THEN 'marker.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS TRUE THEN 'mirror.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS FALSE THEN 'mirror-noframe.svg'::text
WHEN sign.fk_sign_type = 13 THEN 'mirror'||CASE WHEN sign.fk_mirror_shape=12 THEN '-circular' ELSE '' END||CASE WHEN NOT mirror_red_frame THEN '-noframe' ELSE '' END || '.svg'::text
WHEN sign.fk_sign_type = 14 THEN 'street-plate.svg'::text
WHEN sign.fk_sign_type = 15 THEN vl_user_sign.img_de
ELSE NULL::text
Expand All @@ -70,8 +69,7 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
WHEN sign.complex IS TRUE THEN 'complex.svg'::text
WHEN sign.fk_sign_type = 11 THEN vl_official_sign.img_fr
WHEN sign.fk_sign_type = 12 THEN 'marker.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS TRUE THEN 'mirror.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS FALSE THEN 'mirror-noframe.svg'::text
WHEN sign.fk_sign_type = 13 THEN 'mirror'||CASE WHEN sign.fk_mirror_shape=12 THEN '-circular' ELSE '' END||CASE WHEN NOT mirror_red_frame THEN '-noframe' ELSE '' END || '.svg'::text
WHEN sign.fk_sign_type = 14 THEN 'street-plate.svg'::text
WHEN sign.fk_sign_type = 15 THEN vl_user_sign.img_fr
ELSE NULL::text
Expand All @@ -80,8 +78,7 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
WHEN sign.complex IS TRUE THEN 'complex.svg'::text
WHEN sign.fk_sign_type = 11 THEN vl_official_sign.img_it
WHEN sign.fk_sign_type = 12 THEN 'marker.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS TRUE THEN 'mirror.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS FALSE THEN 'mirror-noframe.svg'::text
WHEN sign.fk_sign_type = 13 THEN 'mirror'||CASE WHEN sign.fk_mirror_shape=12 THEN '-circular' ELSE '' END||CASE WHEN NOT mirror_red_frame THEN '-noframe' ELSE '' END || '.svg'::text
WHEN sign.fk_sign_type = 14 THEN 'street-plate.svg'::text
WHEN sign.fk_sign_type = 15 THEN vl_user_sign.img_it
ELSE NULL::text
Expand All @@ -90,8 +87,7 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
WHEN sign.complex IS TRUE THEN 'complex.svg'::text
WHEN sign.fk_sign_type = 11 THEN vl_official_sign.img_ro
WHEN sign.fk_sign_type = 12 THEN 'marker.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS TRUE THEN 'mirror.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS FALSE THEN 'mirror-noframe.svg'::text
WHEN sign.fk_sign_type = 13 THEN 'mirror'||CASE WHEN sign.fk_mirror_shape=12 THEN '-circular' ELSE '' END||CASE WHEN NOT mirror_red_frame THEN '-noframe' ELSE '' END || '.svg'::text
WHEN sign.fk_sign_type = 14 THEN 'street-plate.svg'::text
WHEN sign.fk_sign_type = 15 THEN vl_user_sign.img_ro
ELSE NULL::text
Expand All @@ -100,8 +96,7 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
WHEN sign.complex IS TRUE THEN 'complex.svg'::text
WHEN sign.fk_sign_type = 11 THEN vl_official_sign.img_de_right
WHEN sign.fk_sign_type = 12 THEN 'marker.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS TRUE THEN 'mirror.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS FALSE THEN 'mirror-noframe.svg'::text
WHEN sign.fk_sign_type = 13 THEN 'mirror'||CASE WHEN sign.fk_mirror_shape=12 THEN '-circular' ELSE '' END||CASE WHEN NOT mirror_red_frame THEN '-noframe' ELSE '' END || '.svg'::text
WHEN sign.fk_sign_type = 14 THEN 'street-plate.svg'::text
WHEN sign.fk_sign_type = 15 THEN vl_user_sign.img_de
ELSE NULL::text
Expand All @@ -110,8 +105,7 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
WHEN sign.complex IS TRUE THEN 'complex.svg'::text
WHEN sign.fk_sign_type = 11 THEN vl_official_sign.img_fr_right
WHEN sign.fk_sign_type = 12 THEN 'marker.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS TRUE THEN 'mirror.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS FALSE THEN 'mirror-noframe.svg'::text
WHEN sign.fk_sign_type = 13 THEN 'mirror'||CASE WHEN sign.fk_mirror_shape=12 THEN '-circular' ELSE '' END||CASE WHEN NOT mirror_red_frame THEN '-noframe' ELSE '' END || '.svg'::text
WHEN sign.fk_sign_type = 14 THEN 'street-plate.svg'::text
WHEN sign.fk_sign_type = 15 THEN vl_user_sign.img_fr
ELSE NULL::text
Expand All @@ -120,8 +114,7 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
WHEN sign.complex IS TRUE THEN 'complex.svg'::text
WHEN sign.fk_sign_type = 11 THEN vl_official_sign.img_it_right
WHEN sign.fk_sign_type = 12 THEN 'marker.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS TRUE THEN 'mirror.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS FALSE THEN 'mirror-noframe.svg'::text
WHEN sign.fk_sign_type = 13 THEN 'mirror'||CASE WHEN sign.fk_mirror_shape=12 THEN '-circular' ELSE '' END||CASE WHEN NOT mirror_red_frame THEN '-noframe' ELSE '' END || '.svg'::text
WHEN sign.fk_sign_type = 14 THEN 'street-plate.svg'::text
WHEN sign.fk_sign_type = 15 THEN vl_user_sign.img_it
ELSE NULL::text
Expand All @@ -130,8 +123,7 @@ def vw_sign_symbol(srid: int, pg_service: str = None):
WHEN sign.complex IS TRUE THEN 'complex.svg'::text
WHEN sign.fk_sign_type = 11 THEN vl_official_sign.img_ro_right
WHEN sign.fk_sign_type = 12 THEN 'marker.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS TRUE THEN 'mirror.svg'::text
WHEN sign.fk_sign_type = 13 AND sign.mirror_red_frame IS FALSE THEN 'mirror-noframe.svg'::text
WHEN sign.fk_sign_type = 13 THEN 'mirror'||CASE WHEN sign.fk_mirror_shape=12 THEN '-circular' ELSE '' END||CASE WHEN NOT mirror_red_frame THEN '-noframe' ELSE '' END || '.svg'::text
WHEN sign.fk_sign_type = 14 THEN 'street-plate.svg'::text
WHEN sign.fk_sign_type = 15 THEN vl_user_sign.img_ro
ELSE NULL::text
Expand Down
3 changes: 3 additions & 0 deletions data_model/changelogs/0007/0007_indexes.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
CREATE INDEX sign_fk_frame_idx ON signalo_db.sign (fk_frame);
CREATE INDEX frame_fk_azimut_idx ON signalo_db.frame (fk_azimut);
CREATE INDEX azimut_fk_support_idx ON signalo_db.azimut (fk_support);
2 changes: 2 additions & 0 deletions data_model/demo_data/azimut_content.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('0d8fb844-ec63-43fb-a0e5-cd35a0c62565', '82f3002b-ebdf-4621-9a19-951639fc18bd', 200, NULL, NULL, NULL, '2023-09-06 09:22:19.287', 'Denis Rouzaud', '2023-11-14 05:56:42.155', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('0e2cd688-3984-46b5-9f70-e052305e2cac', 'f5054922-95a7-4f12-8374-0a57e105327c', 290, NULL, NULL, NULL, '2023-02-22 10:06:58.155', 'Denis Rouzaud', '2023-09-07 09:35:52.676', 'Denis Rouzaud', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('1193f576-089a-11eb-8b8b-0242ac110002', '814da66a-0894-11eb-99f5-0242ac110002', 0, NULL, NULL, NULL, '2023-02-22 08:31:37.751308', NULL, '2023-02-22 08:31:37.751308', NULL, false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('38d32a6b-2145-4ac7-b890-7459d67cd167', '94ff73df-fc80-4319-b2b9-7aa06ca4f806', 90, NULL, NULL, NULL, '2024-01-30 10:16:21.373', 'Rouzaud Denis', '2024-01-30 10:54:23.077', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('55ffc93c-fd0f-4c67-8fe7-da217124a793', 'bbdb5d1e-4973-4900-8838-889357a60e65', 180, NULL, NULL, NULL, '2023-09-06 09:22:19.287', 'Denis Rouzaud', '2023-11-24 10:43:42.024', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('779ffe5a-2538-41ed-8abe-79e6825a1b56', '3dbc19a5-b7bf-4acd-94d0-ba4b0b17ddc0', 180, NULL, NULL, NULL, '2024-01-30 10:16:21.373', 'Rouzaud Denis', '2024-01-30 10:54:13.024', 'Rouzaud Denis', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('83fb8a3a-0899-11eb-8b8b-0242ac110002', '814da66a-0894-11eb-99f5-0242ac110002', 200, NULL, NULL, NULL, '2023-02-22 08:31:37.777955', NULL, '2023-02-22 08:31:37.777955', NULL, false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('9dcc763a-1af7-4fb8-9e32-085f74a3ef77', 'a3921fbd-8a89-4d82-b3b8-7a24a16f4df4', 280, NULL, NULL, NULL, '2023-09-07 09:36:47.07', 'Denis Rouzaud', '2023-09-07 09:39:36.121', 'Denis Rouzaud', false, 0, 0);
INSERT INTO signalo_db.azimut (id, fk_support, azimut, usr_azimut_1, usr_azimut_2, usr_azimut_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, offset_x, offset_y) VALUES ('b3fd2055-2ab4-4da8-9dbc-a3aeba311fe7', 'f17d39cc-bac3-4134-9b9c-ea14e228d4b4', 290, NULL, NULL, NULL, '2023-08-31 16:15:55.608', 'Denis Rouzaud', '2023-11-14 08:33:25.694', 'Rouzaud Denis', false, 0, 0);
Expand Down
2 changes: 2 additions & 0 deletions data_model/demo_data/frame_content.sql
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@ INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixin
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('642de2ea-089c-11eb-b19a-0242ac110002', 'dd9e3482-089b-11eb-8b8b-0242ac110002', 2, 3, 11, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-02-22 08:31:38.118357', NULL, '2023-02-22 08:31:38.118357', NULL, false, 'CENTER');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('68cb0b0b-2082-49cc-bf6d-b106c861dada', '9dcc763a-1af7-4fb8-9e32-085f74a3ef77', 3, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-09-07 09:42:33.329', 'Denis Rouzaud', '2023-09-07 09:42:33.329', 'Denis Rouzaud', false, 'CENTER');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('75f4bf9f-5f5e-4362-a4ce-fb29bb8c0123', 'b3fd2055-2ab4-4da8-9dbc-a3aeba311fe7', 2, NULL, NULL, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-08-31 16:19:50.073', 'Denis Rouzaud', '2023-08-31 16:19:50.074', 'Denis Rouzaud', false, 'CENTER');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('79bf0ed6-b98e-4aab-af05-885612053033', '779ffe5a-2538-41ed-8abe-79e6825a1b56', 1, NULL, NULL, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-01-30 10:16:30.856', 'Rouzaud Denis', '2024-01-30 10:18:06.917', 'Rouzaud Denis', false, 'CENTER');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('a088c423-b088-4306-8b7f-a3b1151682ec', '55ffc93c-fd0f-4c67-8fe7-da217124a793', 1, NULL, NULL, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-09-06 09:22:23.311', 'Denis Rouzaud', '2023-11-08 13:28:04.949', 'Rouzaud Denis', false, 'RIGHT');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('a49c33b0-0926-11eb-b4e5-0242ac110002', 'dd9e3482-089b-11eb-8b8b-0242ac110002', 3, 12, 2, false, 1, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-02-22 08:31:38.152963', NULL, '2023-02-22 08:31:38.152963', NULL, false, 'CENTER');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('a899745b-f562-47ca-9175-ef2e19ac18de', 'b3fd2055-2ab4-4da8-9dbc-a3aeba311fe7', 1, NULL, NULL, true, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-08-31 16:16:15.957', 'Denis Rouzaud', '2023-08-31 16:20:57.428', 'Denis Rouzaud', false, 'CENTER');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('bc6eb427-308e-4ff2-a94a-c1a2be2fc5af', '0e2cd688-3984-46b5-9f70-e052305e2cac', 1, 10, NULL, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-02-22 10:07:20.883', 'Denis Rouzaud', '2023-02-22 10:07:20.883', 'Denis Rouzaud', false, 'CENTER');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('c167ced0-efb2-4874-9816-1707f3b6ffec', 'd8a1e45b-7f4c-4c71-a12a-3a2df6d42045', 1, NULL, NULL, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-11-08 13:29:16.487', 'Rouzaud Denis', '2023-11-08 13:31:10.687', 'Rouzaud Denis', false, 'LEFT');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('da131ba0-42ed-4a60-a13d-ac35cea9edc5', 'bbb63098-ee04-4a0d-963d-4df18af5fa7a', 1, NULL, NULL, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-09-06 09:22:23.311', 'Denis Rouzaud', '2023-09-06 09:27:48.611', 'Denis Rouzaud', false, 'RIGHT');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('de543457-a30a-4a5c-b470-6cffb7df792c', '38d32a6b-2145-4ac7-b890-7459d67cd167', 1, NULL, NULL, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2024-01-30 10:16:30.856', 'Rouzaud Denis', '2024-01-30 10:16:30.856', 'Rouzaud Denis', false, 'CENTER');
INSERT INTO signalo_db.frame (id, fk_azimut, rank, fk_frame_type, fk_frame_fixing_type, double_sided, fk_status, fk_provider, comment, picture, dimension_1, dimension_2, usr_frame_1, usr_frame_2, usr_frame_3, _inserted_date, _inserted_user, _last_modified_date, _last_modified_user, _edited, anchor) VALUES ('fdc08784-e5a6-4b0a-a299-2cc3e67a0079', '55ffc93c-fd0f-4c67-8fe7-da217124a793', 2, NULL, NULL, false, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2023-09-06 09:23:15.419', 'Denis Rouzaud', '2023-11-08 13:28:04.973', 'Rouzaud Denis', false, 'LEFT');
Loading

0 comments on commit f5e80c6

Please sign in to comment.