qgisred / QGISRed

GNU General Public License v2.0
23 stars 8 forks source link

Error when open an inp file #89

Open agua1990 opened 1 year ago

agua1990 commented 1 year ago

hello

When i try to open an inp file i have an error for some files

Error: Object reference not set to an instance of an object. at GISRed.Model.Readers.FromInp.?????????????????????????????????????????() at GISRed.Model.Readers.FromInp.?????????????????????????????????????????() at GISRed.Model.Readers.FromInp.ReadInp(String inpFile, Boolean allInp) at GISRed.ExtendedModel.ExtendedScenario.ReadExtendedInp(Logger logger, String inpFile) at GISRed.QGisPlugins.QGisPlugins.ImportFromInp(String dirPath, String networkName, String tempPath, String inpFile, String epsg)

do you have any idea why there is this error for certain inp files ?

this error with (1.0.16/1.0.16.2)

neslerel commented 1 year ago

To debug the error we will need the inp file. Could you send one of them to qgisred@upv.es?

agua1990 commented 1 year ago

I just found the solution to the problem, in the .inp there is the source quality without a time model and this is the cause of the problem. by adding it it works (you can close the issue)

neslerel commented 1 year ago

Thanks @agua1990 for finding the problem. I fixed it to avoid this uncontrolled error. At the end, Epanet allows to define sources without a pattern, so QGISRed as well.

neslerel commented 1 year ago

When we'll realase a new beta versión, I'll tell you to test it with the INP files that failed you.

wciezak commented 1 year ago

Hello, missing source pattern still causes error (version 1.0.16.7):

CRITICAL Error : Object reference not set to an instance of an object. at GISRed.Model.Readers.FromInp.?????????????????????????????????????????() at GISRed.Model.Readers.FromInp.?????????????????????????????????????????() at GISRed.Model.Readers.FromInp.ReadInp(String inpFile, Boolean allInp) at GISRed.ExtendedModel.ExtendedScenario.ReadExtendedInp(Logger logger, String inpFile) at GISRed.QGisPlugins.QGisPlugins.ImportFromInp(String dirPath, String networkName, String tempPath, String inpFile, String epsg)

--> [SOURCES] ;Node Type Quality Pattern ZBD-1 CONCEN 0.3
-->

INP file to download at the link: https://www.wciezak.eu/!download/net-01.inp

wciezak commented 1 year ago

Hello again. Reinstalling the plugin along with the dll files solved the problem. Now the file imports correctly without error. Sorry for the confusion.

Neibafh commented 10 months ago

Hello

When i try to open an inp file i have an error for some files

Error: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.ThrowHelper.ThrowArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) at GISRed.Model.Misc.Rule.CombineConditionsFromInp(List`1 operators) at GISRed.Model.Readers.FromInp.?????????????????????????????????????????() at GISRed.Model.Readers.FromInp.ReadInp(String inpFile, Boolean allInp) at GISRed.ExtendedModel.ExtendedScenario.ReadExtendedInp(Logger logger, String inpFile) at GISRed.QGisPlugins.QGisPlugins.ImportFromInp(String dirPath, String networkName, String tempPath, String inpFile, String epsg)

do you have any idea why there is this error for certain inp files ? I've send my INP to you at qgisred@upv.es.