1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
void FenPrincipale::ihmPrintf(T_irsRptLevel VEG_rptLevel, char** RptBuffer,char *PCP_fmt, ... )
{
int ret;
char MCL_ihmInfoBuffer[MAX_LENGTH_BUFFER];
char MCL_ihmWarningBuffer[MAX_LENGTH_BUFFER];
char MCL_ihmErrorBuffer[MAX_LENGTH_BUFFER];
char pBuffer[MAX_LENGTH_BUFFER];
char pBufferFmt[MAX_LENGTH_BUFFER];
strcpy(pBuffer,"<strong>***<u> ");
// écriture du type d'info
strcpy(MCL_ihmInfoBuffer,"<font color=blue> ");
strcpy(MCL_ihmWarningBuffer,"<font color=orange> ");
strcpy(MCL_ihmErrorBuffer,"<font color=red> ");
// copie des messages
strcat(MCL_ihmInfoBuffer,RptBuffer[0]);
strcat(MCL_ihmInfoBuffer,"</font><p>");
strcat(MCL_ihmWarningBuffer,RptBuffer[1]);
strcat(MCL_ihmWarningBuffer,"</font><p>");
strcat(MCL_ihmErrorBuffer,RptBuffer[2]);
strcat(MCL_ihmErrorBuffer,"</font><p>");
va_start(PCL_arg, PCP_fmt);
ret = vsprintf(pBufferFmt, PCP_fmt, PCL_arg);
strcat(pBuffer,pBufferFmt);
strcat(pBuffer,"</u>***</strong><br>");
this->debug_textEdit->appendHtml(pBuffer);
switch(VEG_rptLevel)
{
case info :
// écriture du message error
if(strcmp(MCL_ihmErrorBuffer,"")!=0)
this->debug_textEdit->appendHtml(MCL_ihmErrorBuffer);
// écriture du message warning
if(strcmp(MCL_ihmWarningBuffer,"")!=0)
this->debug_textEdit->appendHtml(MCL_ihmWarningBuffer);
// écriture du message info
if(strcmp(MCL_ihmInfoBuffer,"")!=0)
this->debug_textEdit->appendHtml (MCL_ihmInfoBuffer);
break;
case warning :
// écriture du message error
if(strcmp(MCL_ihmErrorBuffer,"")!=0)
this->debug_textEdit->appendHtml(MCL_ihmErrorBuffer);
// écriture du message warning
if(strcmp(MCL_ihmWarningBuffer,"")!=0)
this->debug_textEdit->appendHtml(MCL_ihmWarningBuffer);
break;
case error:
// écriture du message error
if(strcmp(MCL_ihmErrorBuffer,"")!=0)
{
this->debug_textEdit->appendHtml(MCL_ihmErrorBuffer);
}
break;
default :
break;
}
// effacement du contenu des tableaux
strcpy(MCL_ihmWarningBuffer,"");
strcpy(MCL_ihmErrorBuffer,"");
strcpy(MCL_ihmInfoBuffer,"");
strcpy(RptBuffer[0],"");
strcpy(RptBuffer[1],"");
strcpy(RptBuffer[2],"");
va_end(PCL_arg);
} |
Partager