ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/aster/src/mglanceuraster.cpp
Revision: 773
Committed: Mon Jan 18 16:07:28 2016 UTC (9 years, 3 months ago) by francois
File size: 1364 byte(s)
Log Message:
Correction de differents bug d'interface avec aster
* code de retour de aster
* calcul aux elements 
* calcul poutre_volume et volume et coque

File Contents

# User Rev Content
1 francois 773 #include "gestionversion.h"
2     #include "mglanceuraster.h"
3    
4    
5    
6    
7     MGLANCEURASTER::MGLANCEURASTER()
8     {
9     }
10    
11     MGLANCEURASTER::MGLANCEURASTER(MGLANCEURASTER& mdd)
12     {
13     }
14    
15    
16     MGLANCEURASTER::~MGLANCEURASTER()
17     {
18     }
19    
20    
21     int MGLANCEURASTER::execute(OT_PARAMETRES& param, char* nometude)
22     {
23     char nomfichiertmp[255];
24     int choix=(int)param.get_valeur("Affiche_Code_Aster");
25     #ifdef CHOIXTERMASTER
26     if (choix!=0)
27     {
28     char chaine[500];
29     sprintf(chaine,"%s.run",nometude);
30     FILE* in=fopen(chaine,"wt");
31     fprintf(in,"%s/as_run %s.export\necho $?>%s.retour\n",getenv("PATHASTER"),nometude,nometude);
32     fclose(in);
33     sprintf(nomfichiertmp,"chmod u+x %s",chaine);
34     system(nomfichiertmp);
35     sprintf(nomfichiertmp,"xterm -e \"%s\"",chaine);
36     }
37     else sprintf(nomfichiertmp,"%s/as_run %s.export 1>aster.log 2>&1;echo $?>%s.retour",getenv("PATHASTER"),nometude,nometude);
38     #else
39     sprintf(nomfichiertmp,"%s/as_run %s.export 1>aster.log 2>&1;echo $?>%s.retour",getenv("PATHASTER"),nometude,nometude);
40     #endif
41    
42     system(nomfichiertmp);
43     int codesortie=10000;
44     char chaine[500];
45     sprintf(chaine,"%s.retour",nometude);
46     FILE *out=fopen(chaine,"rt");
47     if (out!=NULL)
48     {
49     fgets(chaine,500,out);
50     sscanf(chaine,"%d",&codesortie);
51     fclose(out);
52     }
53     #ifdef CHOIXTERMASTER
54     if (choix!=0)
55     {
56     char chaine[500];
57     sprintf(chaine,"rm %s.run",nometude);
58     system(chaine);
59     }
60     #endif
61     return codesortie;
62     }
63