FLO-2DSoftware / qgis-flo-2d-plugin

A plugin for pre-processing/post-processing FLO-2D models
6 stars 7 forks source link

Select components from shapefile: Check that fields from shapefile and layer are of the same type #1334

Closed FLO-2DJJ closed 4 months ago

FLO-2DJJ commented 4 months ago

Check that the fields selected from the shapefiles are of the same type of the layer fields. For example, if the user selects a string to assign to a number, an error may immediately occur or cascade for a later error, like:

image

image

rpachaly commented 4 months ago

Hi JJ, I agree with you! This check is a very good feature and should be implemented.

FLO-2DJJ commented 4 months ago

Solved in pull request #1344.

FLO-2DKaren commented 4 months ago

@FLO-2DJJ @rpachaly Would it be hard to back this code off? It's causing more errors than it fixed.

FLO-2DJJ commented 4 months ago

Wait. I'm looking at it.

FLO-2DJJ commented 4 months ago

It's causing more errors than it fixed.

@FLO-2DKaren, I do not see the errors with the projects on which I’m conducting the tests. Could you please send me the project that is giving you errors? Thanks.

FLO-2DKaren commented 4 months ago

I'm trying to build the project so I can share it for testing but I can't get past the dialog because its looking for inlet type = string but inlet type is a integer 0 - 5.

Then when I try to load the shapefile fields again, they are all shifted.

Advanced Storm Drain Shapefiles.zip

FLO-2DJJ commented 4 months ago

I'm trying to build the project so I can share it for testing but I can't get past the dialog because its looking for inlet type = string but inlet type is a integer 0 - 5.

OK. I see the problem.

FLO-2DKaren commented 4 months ago

JJ,

Here is a project and video. I think Robson's smart code that finds the field by name was overridden by your code.

https://flo-2d.sharefile.com/d-s139be3191fca43cd9eb67937604b4e58

FLO-2DKaren commented 4 months ago

@FLO-2DJJ Let's use this issue to correct the plugin. I added it to the milestones so the District can see the progress.

FLO-2DJJ commented 4 months ago

This is being addressed in pull request #1348. DO NOT merge and close the pull request yet.

FLO-2DKaren commented 4 months ago

OK but maybe don't do a pull request until its ready so that it doesn't get stagnant.

FLO-2DJJ commented 4 months ago

OK but maybe don't do a pull request until its ready so that it doesn't get stagnant.

You are right @FLO-2DKaren. I just wanted to be able merge the pull request to master with a commit that I made to allow all types of data in the inlet type field only, and then continue with other commits. But it seems that, once the pull request is merged, it is also closed.

So, I'm going to merge this #1348, which shows all the fields for the inlet type, and continue with the branch that originated it. DO NOT close the branch

1334_allow_all_types_in_lists_in_select_components_from_shapefile

where I will make all the next commits before making a final new pull request.

FLO-2DJJ commented 4 months ago

Found the problem: after the filtering of types, smart code needs to be changed to find item by substring. Fixed for inlets. I'll continue with the other components.

FLO-2DKaren commented 4 months ago

@FLO-2DJJ I tested this and I think it is working good. I'm going to close it for now.