ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/REPOS_ERICCA/magic/lib/aster/src/mglanceuraster.cpp
Revision: 963
Committed: Mon Aug 20 13:41:47 2018 UTC (6 years, 8 months ago) by francois
File size: 1546 byte(s)
Log Message:
integration de code aster version 13.6

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 francois 963 int MGLANCEURASTER::execute(OT_PARAMETRES& param, char* nometude,double version)
22 francois 773 {
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 francois 963 if (version>13)
62     if (codesortie==0)
63     {
64     strcpy(chaine,nometude);
65     strcat(chaine,".resu");
66     FILE* intmp=fopen(chaine,"at");
67     fprintf(intmp,"\n");
68     fclose(intmp);
69     }
70 francois 773 return codesortie;
71     }
72