Cloud_02.SetName( "Cloud_02" )
Cloud_02.SetAltitudesInverted( 0 );
-Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))
+if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
Cloud_02.Update()
Cloud_inexistant.SetName( "Cloud_inexistant" )
Cloud_inexistant.SetAltitudesInverted( 0 );
-Cloud_inexistant.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_inexistant.xyz" ))
+ret = Cloud_inexistant.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_inexistant.xyz" ))
-# TODO : ce chargement doit echouer avec un retour d'erreur à traiter
-raise ValueError('file not found')
-
-Cloud_inexistant.Update()
+if ret:
+ raise ValueError('loading problem not detected: return value should be null')
if salome.sg.hasDesktop():
salome.sg.updateObjBrowser(1)
Cloud_02.SetName( "Cloud_02" )
Cloud_02.SetAltitudesInverted( 0 )
-Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))
+if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
Cloud_02.Update()
garonne_point_L93.SetName( "garonne_point_L93" )
garonne_point_L93.SetAltitudesInverted( 0 )
-garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))
+if not(garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
garonne_point_L93.Update()
Cloud_02.SetName( "Cloud_02" )
Cloud_02.SetAltitudesInverted( 0 )
-Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))
+if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
Cloud_02.Update()
garonne_point_L93.SetName( "garonne_point_L93" )
garonne_point_L93.SetAltitudesInverted( 0 )
-garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))
+if not(garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
garonne_point_L93.Update()
Cloud_02.SetName( "Cloud_02" )
Cloud_02.SetAltitudesInverted( 0 )
-Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))
+if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
Cloud_02.Update()
garonne_point_L93.SetName( "garonne_point_L93" )
garonne_point_L93.SetAltitudesInverted( 0 )
-garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))
+if not(garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
garonne_point_L93.Update()
Cloud_02.SetName( "Cloud_02" )
Cloud_02.SetAltitudesInverted( 0 )
-Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))
+if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
Cloud_02.Update()
garonne_point_L93.SetName( "garonne_point_L93" )
garonne_point_L93.SetAltitudesInverted( 0 )
-garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))
+if not(garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
garonne_point_L93.Update()
Cloud_02.SetName( "Cloud_02" )
Cloud_02.SetAltitudesInverted( 0 )
-Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))
+if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
Cloud_02.Update()
garonne_point_L93.SetName( "garonne_point_L93" )
garonne_point_L93.SetAltitudesInverted( 0 )
-garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))
+if not(garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
garonne_point_L93.Update()
Cloud_02.SetName( "Cloud_02" )
Cloud_02.SetAltitudesInverted( 0 )
-Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))
+if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
Cloud_02.Update()
garonne_point_L93.SetName( "garonne_point_L93" )
garonne_point_L93.SetAltitudesInverted( 0 )
-garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))
+if not(garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
garonne_point_L93.Update()
Cloud_02.SetName( "Cloud_02" )
Cloud_02.SetAltitudesInverted( 0 )
-Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))
+if not(Cloud_02.ImportFromFile( os.path.join(HYDRO_SAMPLES, "Cloud_02.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
Cloud_02.Update()
garonne_point_L93.SetName( "garonne_point_L93" )
garonne_point_L93.SetAltitudesInverted( 0 )
-garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))
+if not(garonne_point_L93.ImportFromFile( os.path.join(HYDRO_SAMPLES, "garonne_point_L93.xyz" ))):
+ raise ValueError('problem while loading bathymetry')
garonne_point_L93.Update()
.arg( aBathymetryName ).arg( IsAltitudesInverted() );
TCollection_AsciiString aFilePath = GetFilePath();
- aResList << QString( "%1.ImportFromFile( \"%2\" )" )
+ aResList << QString( "if not(%1.ImportFromFile( \"%2\" )):" )
.arg( aBathymetryName ).arg( aFilePath.ToCString() );
-
+ aResList << QString( " raise ValueError('problem while loading bathymetry')" );
aResList << QString( "" );
aResList << QString( "%1.Update()" ).arg( aBathymetryName );
aResList << QString( "" );