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 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134
|
//File for handling warnings, errors, messages
#include <meshing.hpp>
namespace netgen
{
// int printmessage_importance = 3;
int printwarnings = 1;
int printerrors = 1;
int printdots = 1;
int printfnstart = 0;
// extern void Ng_PrintDest(const MyStr& s);
extern void Ng_PrintDest(const char * s);
//the dots for progression of program
void PrintDot(char ch)
{
// if (printdots)
if (printmessage_importance >= 4)
{
char st[2];
st[0] = ch;
st[1] = 0;
Ng_PrintDest(st);
}
}
void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2)
{
if (importance <= printmessage_importance)
{
Ng_PrintDest(MyStr(" ")+s1+s2+MyStr("\n"));
}
}
void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4)
{
if (importance <= printmessage_importance)
{
Ng_PrintDest(MyStr(" ")+s1+s2+s3+s4+MyStr("\n"));
}
}
void PrintMessage(int importance,
const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6, const MyStr& s7, const MyStr& s8)
{
if (importance <= printmessage_importance)
{
Ng_PrintDest(MyStr(" ")+s1+s2+s3+s4+s5+s6+s7+s8+MyStr("\n"));
}
}
void PrintMessageCR(int importance,
const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6, const MyStr& s7, const MyStr& s8)
{
if (importance <= printmessage_importance)
{
Ng_PrintDest(MyStr(" ")+s1+s2+s3+s4+s5+s6+s7+s8+MyStr("\r"));
}
}
void PrintFnStart(const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6, const MyStr& s7, const MyStr& s8)
{
if (printfnstart)
Ng_PrintDest(MyStr(" Start Function: ")+s1+s2+s3+s4+s5+s6+s7+s8+MyStr("\n"));
}
void PrintWarning(const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6, const MyStr& s7, const MyStr& s8)
{
if (printwarnings)
Ng_PrintDest(MyStr(" WARNING: ")+s1+s2+s3+s4+s5+s6+s7+s8+MyStr("\n"));
}
void PrintError(const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6, const MyStr& s7, const MyStr& s8)
{
if (printerrors)
Ng_PrintDest(MyStr(" ERROR: ")+s1+s2+s3+s4+s5+s6+s7+s8+MyStr("\n"));
}
void PrintFileError(const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6, const MyStr& s7, const MyStr& s8)
{
if (printerrors)
Ng_PrintDest(MyStr(" FILE ERROR: ")+s1+s2+s3+s4+s5+s6+s7+s8+MyStr("\n"));
}
void PrintUserError(const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6, const MyStr& s7, const MyStr& s8)
{
Ng_PrintDest(MyStr(" USER ERROR: ")+s1+s2+s3+s4+s5+s6+s7+s8+MyStr("\n"));
}
void PrintSysError(const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6, const MyStr& s7, const MyStr& s8)
{
if (printerrors)
Ng_PrintDest(MyStr(" SYSTEM ERROR: ")+s1+s2+s3+s4+s5+s6+s7+s8+MyStr("\n"));
}
void PrintTime(const MyStr& s1, const MyStr& s2, const MyStr& s3, const MyStr& s4,
const MyStr& s5, const MyStr& s6, const MyStr& s7, const MyStr& s8)
{
if (printmessage_importance >= 3)
Ng_PrintDest(MyStr(" Time = ")+s1+s2+s3+s4+s5+s6+s7+s8+MyStr("\n"));
}
/*
#ifdef SMALLLIB
#define SMALLLIBORNOTCL
#endif
#ifdef NOTCL
#define SMALLLIBORNOTCL
#endif
#ifdef SMALLLIBORNOTCL
void Ng_PrintDest(const char * s){cout << s <<flush;}
double GetTime(){return 0;}
void MyError(const char * ch)
{
cerr << ch << endl;
}
#endif
*/
}
|