Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pipe_section : cascading values for value lists #53

Open
jpdupuy opened this issue Aug 29, 2024 · 21 comments
Open

pipe_section : cascading values for value lists #53

jpdupuy opened this issue Aug 29, 2024 · 21 comments
Assignees
Labels
enhancement New feature or request

Comments

@jpdupuy
Copy link
Collaborator

jpdupuy commented Aug 29, 2024

Whenever the end user introduces data in the pipe_section form, there is no control on the inner, outer, nominal diameter which are allowed with the previously selected pipe material (pipeline_quality).
This issue has been raised by the initiators of the TDH module during the presentation I gave.

This mechanism exist in the TWW and TWA module, and should be implemented in the TDH module.
The development guide should also explain how to handle this issue (both datamodel and QGIS form side)

Reference pipe material catalog : https://github.com/qwat/qwat-data-model/blob/master/value_lists/vl_pipe_material.sql

@sjib sjib added the enhancement New feature or request label Nov 1, 2024
@sjib
Copy link
Contributor

sjib commented Nov 28, 2024

@sjib
Copy link
Contributor

sjib commented Nov 28, 2024

  • check on qwat how this is implemented
  • check if this is a good way how to implement this kind of catalogue on all TEKSI module
  • implement in tdh
  • document in Developers how to implement this in a QGIS project @sjib

@sjib sjib assigned sjib and jpdupuy Nov 28, 2024
@jpdupuy
Copy link
Collaborator Author

jpdupuy commented Nov 28, 2024

Please find the catalog (ref page 209)
13.4 Dimensions et rejets de chaleur spéc. pour tubes pré-isolés en métal, tubes médians en métal et tubes médians en plastique
GdP-CAD_V1.0.pdf

Please find the xls file I have built to load and test in the tdh_vl schema
TDH_pipe_material_dn_catalog.xlsx

@jpdupuy
Copy link
Collaborator Author

jpdupuy commented Feb 4, 2025

Image
Once the pipeline_quality has been selected, the nominal_diameter list is presented according to this selection

Image

nominal_diameter properties for the pipe_section form

Image

pipe_section_pipe_dn_Sql.txt

@sjib
Copy link
Contributor

sjib commented Feb 4, 2025

@jpdupuy Looks nice - I created a pull request to integrate this.

@sjib
Copy link
Contributor

sjib commented Feb 6, 2025

So I reviewd the issue and try to explain of what I understood:
We are creating an new extra attribute to the class pipe_section (extension to the offical data model) to ease the filling out of the following attributes:

  • pipe_section.pipeline_quality [steel_35, steel_35_8, steel_37, steel_52, copper, plastic, chrome_steel]
  • pipe_section.diameter_inner [smallint]
  • pipe_section.diameter_outer [smallint]
  • pipe_section.nominal_diameter [text]

The new attribute is called pipe_section_mg_material (suggestion from @ponceta with extra prefix mg_ (addition from @sjib - as it is a adaption for Morges (instead of pipe_dn, to be in line with what has been done on qwat)
Along goes a extended value list (tdh_vl.pipe_section_mg_material) with includes values to be added to the other attributes in the columns:

  • diameter_nominal and diameter (suggestion to rename to nominal_diameter to fit data model attribute name or else to rename attribute to fit this translation, column diameter is already [char])
  • diameter_internal (suggestion to rename to diameter_inner to fit data model attribute name or else to rename attribute to fit this translation, add values in [mm] instead of [cm] - else they have to be converted to fit data model data type)
  • diameter_external (suggestion to rename to diameter_outer to fit data model attribute name or else to rename attribute to fit this translation, add values in [mm] instead of [cm] - else they have to be converted to fit data model data type)
  • fk_pipe_quality (suggestion to rename to pipeline_qualitiy)

Image

Image

As far as I understand the drafts for the project form fills in nominal_diameter. What about the other attributes?

So I will not delete the attribute nominal_diameter and delete this part again

ALTER TABLE tdh_od.pipe_section
DROP COLUMN IF EXISTS nominal_diameter;

ALTER TABLE tdh_od.pipe_section ADD COLUMN nominal_diameter integer;

@jpdupuy @ponceta Did I understand the idea correctly. Do you agree with my suggestions to adapt the create code?

@jpdupuy
Copy link
Collaborator Author

jpdupuy commented Feb 7, 2025

@sjib Yes you understood correctly the idea.
I also understand that we have 2 different ways to capture the nominal_diameter, diameter_inner, diameter_outer.

  • the SIA data model (direct input by user)( a bit painfull by interlis compatible)
  • the Morges data model (cascading from material ie: steel, plastic )(more convenient but need triggers to copy values in SIA fields)

I would suggest to rename pipeline_quality to pipe_quality, since all other attributes have the same prefix pipe_type and pipe_brand
Is pipeline_quality an error in the SIA datamodel, or is it made on purpose ?

The value list must be reviewed pipe_section_pipeline_quality :

  • steel_35, steel_35_8, steel_37, steel_52 : it is a mix of material and diameter
  • copper : do not exist for chauffage à distance

Please replace the values in pipe_section_pipeline_quality by :

Image

@ponceta We also need your approval to match the TWW and TWA implementation

@sjib
Copy link
Contributor

sjib commented Feb 7, 2025

@jpdupuy I can only adapt the English translation but not contents of a value list. I know it's a mix, therefore it is ok to build this user friendly way of choosing, but at the end we have to have filled in the official values (also).

@jpdupuy
Copy link
Collaborator Author

jpdupuy commented Feb 7, 2025

@sjib Well, this is taken from the official catalog. Please find the catalog (ref page 209)
13.4 Dimensions et rejets de chaleur spéc. pour tubes pré-isolés en métal, tubes médians en métal et tubes médians en plastique
GdP-CAD_V1.0.pdf
I believe the SIA value list was totally incomplete in 2015. You cannot just have : steel_35, steel_35_8, steel_37, steel_52

At least we also need to add the unknown value, such as in many value lists. The nominal diameter might be known, but he pipe material would be unknown

@sjib
Copy link
Contributor

sjib commented Feb 7, 2025

@sjib Well, this is taken from the official catalog. Please find the catalog (ref page 209) 13.4 Dimensions et rejets de chaleur spéc. pour tubes pré-isolés en métal, tubes médians en métal et tubes médians en plastique GdP-CAD_V1.0.pdf I believe the SIA value list was totally incomplete in 2015. You cannot just have : steel_35, steel_35_8, steel_37, steel_52

At least we also need to add the unknown value, such as in many value lists. The nominal diameter might be known, but he pipe material would be unknown

@jpdupuy These are all very good comments that I happily pass on to the technical association "Réseaux Thermiques Suisse" so these can be considered in a future model release.

@sjib
Copy link
Contributor

sjib commented Feb 7, 2025

I think the values steel_35 etc. are not material and diameter but define the quality of the steel:

steel_35:
So ist St35 die alte Bezeichnung für einen unlegierten Baustahl mit der aktuell gültigen Stoffnummer 1.0308 und Bezeichnung S235G2T, welcher hauptsächlich in der Produktion und weiteren Verwendung von Stahlrohren eine Rolle spielt.

Ainsi, St35 est l'ancienne désignation d'un acier de construction non allié dont le numéro de matériau actuellement en vigueur est 1.0308 et la désignation S235G2T, qui joue principalement un rôle dans la production et l'utilisation ultérieure de tubes en acier.

https://www.helpster.de/st35-stahl-informatives-zum-bezeichnungssystem_190739

Or
steel 35 8:
https://pauly-stahlhandel.com/de/din-en/st-35.8

steel 37: e.g. https://www.weltstahl.com/stahl-st37-datenblatt-werkstoff-1-0037-din-17100-baustahl/

@sjib
Copy link
Contributor

sjib commented Feb 7, 2025

@jpdupuy
We have

ALTER TABLE tdh_vl.pipe_section_mg_material ADD COLUMN diameter        character varying(30) COLLATE pg_catalog."default";
ALTER TABLE tdh_vl.pipe_section_mg_material ADD COLUMN diameter_nominal  smallint;

diameter_nominal should correspond to pipe_section.diameter_nominal. Is it ok to change the datatyp to text so a trigger could copy that value?

@sjib
Copy link
Contributor

sjib commented Feb 7, 2025

@ponceta Are triggers the right way to update other attributes based on the selected pipe_section.mg_material? Do we have already an example I could copy?

@jpdupuy
Copy link
Collaborator Author

jpdupuy commented Feb 7, 2025

@sjib I believe smallint is fine (it depends on the units)

@sjib
Copy link
Contributor

sjib commented Feb 7, 2025

Diameter_nominal is defined as text as it could be also e.g 1200/800

@jpdupuy
Copy link
Collaborator Author

jpdupuy commented Feb 7, 2025

@sjib The smallint type can hold values from -32,768 to 32,767,
However in the SIA data model, it is defined as text to be able to hold values in inches

@sjib
Copy link
Contributor

sjib commented Feb 13, 2025

@jpdupuy I found another document that tries to implement SIA405 Fernwaerme:
https://raumdatenpool.ch/Dokumente/RDP_Spezifikationen_SIA405_thermischeNetze_V1.1.zip

Maybe there are some more helpful hints.

@jpdupuy
Copy link
Collaborator Author

jpdupuy commented Feb 13, 2025

@sjib Thank you, it is an interesting document. Some hints might be helpful.
However, The cascading values are not described in this document.
This mechanism exists in the TWW and TWA module, and was implemented by Arnaud.

@sjib
Copy link
Contributor

sjib commented Feb 13, 2025

@jpdupuy yes. There might be some hints on material and abbreviations

@sjib
Copy link
Contributor

sjib commented Mar 4, 2025

@jpdupuy Add final way of integration

@jpdupuy
Copy link
Collaborator Author

jpdupuy commented Mar 4, 2025

At first, define the joint

Image
Then, define the relationnel value and the expression filter

Image

Note : the inner and outer diameter does not display immediately on the form. It is refreshed once the form get closed and reopens.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants