Import a MASCARET model from files
[error] = MASCARET_importModel(id,TabFileName,TypeFileName,print)
(Output argument) Error code value : zero indicates that no errors occurred
MASCARET instance number returned by the function MASCARET_create
Table file names of MASCARET to import (a file name must not exceed 255 characters, the names can be absolute, the separator depends on the host).
TypeFileName : Table file types of MASCARET to import . It is not possible to import an initial solution on the water levele with this function. Possible values are :
"casier"
"geo"
"loi"
"xcas"
"listing"
"res"
"listing_casier"
"listing_liaison"
"res_casier"
"res_liaison"
print (write) on the listing files (1-> True 0-> False)
Import a MASCARET model from files
This function reads a MASCARET model from files. The files are created by the GUI software FUDAA-MASCARET with the action : « File | Export | Mascaret ».
Before using this function, it is necessary to initialise the MASCARET model, with the help of the function MASCARET_create. If only the state has to be imported, it is necessary to initialise the model with the function MASCARET_importModel.
toolbox_dir=getenv("toolbox_dir"); c = filesep(); // creation of the MASCARET model [err, id] = MASCARET_create(); assert_checktrue(id>0); // read data from files path_xml = "file://"+toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1.xcas"; TabNomFichier = [strsubst(path_xml,'\','/'), .. toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1.geo", .. toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1_0.loi", .. toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1_1.loi", .. toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1.lis", .. toolbox_dir+c+"demos"+c+"Help"+c+"demo1"+c+"demo1.opt"]; TypeNomFichier = ["xcas","geo","loi","loi","listing","res"]; impression = 0; err = MASCARET_importModel(id,TabNomFichier,TypeNomFichier,impression); assert_checkequal(err,0); // model deletion err = MASCARET_delete(id); assert_checkequal(err,0); | ![]() | ![]() |