jorgealmerio / QWater

Hydraulic design and analysis of water supply networks
20 stars 8 forks source link

Error: unable to locate Result_Flo field #17

Open melgamal-gethub opened 5 months ago

melgamal-gethub commented 5 months ago

Dear developer of the plugin First of all, I would like to thank you for your huge effort in producing such a useful QWATER plugin that makes dealing with EPANET much easier. I used QWATER plug in successfully before but recently while using QGIS 3.34 I have received this error "unable to locate Result_Flo field" and I found that the attribute table of the pipes and nodes are not updated to include the EPANET model results despite that the model "EPANET" successfuly solved the network without errors or warnings. Any suggestion to solve this error are highly appreciated. M. Elgamal image

jorgealmerio commented 5 months ago

The results fields are checked and created every time you click Run Epanet simulation.

" for fieldname in results: if -1 == provider.fieldNameIndex(fieldname): attributes.append(QgsField(fieldname, QVariant.Double)) provider.addAttributes(attributes) layer.updateFields() "

Maybe you can share the error Traceback. What system are you using? What Qgis version? What QWater version?

Thank you!

melgamal-gethub commented 5 months ago

Thanks for your reply: Here are more details:

melgamal-gethub commented 5 months ago

For the OS, I am using Windows 11

jorgealmerio commented 5 months ago

To get the traceback. image

jorgealmerio commented 5 months ago

Please check your "Trechos" layer has the results fields. (RESULT_FLO, RESULT_VEL, ...) image

melgamal-gethub commented 5 months ago

Thanks for your reply. No there is no results fields. (RESULT_FLO, RESULT_VEL, ...) in the attribute table of the pipes or the junctions. I will paste the traceback data as appeared: image image

melgamal-gethub commented 5 months ago

image As you see despite the EPANET has solved the network but the results are not uploaded back to the attribute tables of both pipes and junctions thus pipe resizing was not able to be conducted.

melgamal-gethub commented 5 months ago

By the way, I have updated the python two weeks ago. The currently working version now is 3.9.6. Can this update affects the subroutines of QWater. Because before it is smoothly working.

melgamal-gethub commented 5 months ago

image

jorgealmerio commented 5 months ago

The routine would create the results fields when run model. Meanwhile you can manually create the fields or use the sample layer (that has the fields) shipped with the plugin. You can find the Trechos layer by QWater menu: image

melgamal-gethub commented 5 months ago

Today, I got a brandnew laptop and I installed QGIS 3.36 and QWATER and I tried to design a new network using QWATER and I got the same error message then I opened all the attribute tables and deleted the first id field while keeping the DC_ID as the first column and after doing so the plugin worked fine with no error message. When I went to the terminal to check the version of the python for my new laptop (as I did not install any new python on it yet) it showed me Python39 which I guess is the same version in my other laptop

melgamal-gethub commented 5 months ago

Dear developer of the plugin First of all, thank you again for trying to help me how to fix the error I am facing.I have prepared a youtube video that shows how to use Qwater to design a WDN and how did I manage to solve the error that appeared regarding the Result_Flo field. The youtube is in Arabic but with English subtitles provided. The link is shown below: https://www.youtube.com/watch?v=nOTe8Xc3KQc&t=577s Regards