Changeset 14497 for trunk/FACT++/src
- Timestamp:
- 10/19/12 14:10:34 (12 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/InterpreterV8.cc
r14185 r14497 257 257 if (*str) 258 258 JsPrint(*str); 259 } 260 return Undefined(); 261 } 262 263 Handle<Value> InterpreterV8::FuncAlarm(const Arguments& args) 264 { 265 for (int i=0; i<args.Length(); i++) 266 { 267 const HandleScope handle_scope; 268 269 const String::Utf8Value str(args[i]); 270 if (*str) 271 JsAlarm(*str); 259 272 } 260 273 return Undefined(); … … 683 696 Handle<ObjectTemplate> dim = ObjectTemplate::New(); 684 697 dim->Set(String::New("print"), FunctionTemplate::New(WrapPrint), ReadOnly); 698 dim->Set(String::New("alarm"), FunctionTemplate::New(WrapAlarm), ReadOnly); 685 699 dim->Set(String::New("out"), FunctionTemplate::New(WrapOut), ReadOnly); 686 700 dim->Set(String::New("wait"), FunctionTemplate::New(WrapWait), ReadOnly); -
trunk/FACT++/src/InterpreterV8.h
r14177 r14497 35 35 v8::Handle<v8::Value> FuncSleep(const v8::Arguments& args); 36 36 v8::Handle<v8::Value> FuncPrint(const v8::Arguments& args); 37 v8::Handle<v8::Value> FuncAlarm(const v8::Arguments& args); 37 38 v8::Handle<v8::Value> FuncOut(const v8::Arguments& args); 38 39 v8::Handle<v8::Value> FuncInclude(const v8::Arguments& args); … … 50 51 static v8::Handle<v8::Value> WrapInclude(const v8::Arguments &args) { if (This) return This->FuncInclude(args); else return v8::Undefined(); } 51 52 static v8::Handle<v8::Value> WrapPrint(const v8::Arguments &args) { if (This) return This->FuncPrint(args); else return v8::Undefined(); } 53 static v8::Handle<v8::Value> WrapAlarm(const v8::Arguments &args) { if (This) return This->FuncAlarm(args); else return v8::Undefined(); } 52 54 static v8::Handle<v8::Value> WrapOut(const v8::Arguments &args) { if (This) return This->FuncOut(args); else return v8::Undefined(); } 53 55 static v8::Handle<v8::Value> WrapWait(const v8::Arguments &args) { if (This) return This->FuncWait(args); else return v8::Undefined(); } … … 84 86 virtual void JsEnd(const std::string &) { } 85 87 virtual void JsPrint(const std::string &) { } 88 virtual void JsAlarm(const std::string &) { } 86 89 virtual void JsOut(const std::string &) { } 87 90 virtual void JsResult(const std::string &) { } -
trunk/FACT++/src/MessageImp.cc
r13207 r14497 92 92 //! kWarn: yellow W> 93 93 //! kError: red E> 94 //! kAlarm red E> 94 95 //! kFatal: red-blink !> 95 96 //! kDebug: blue … … 117 118 case kInfo: fOut << kGreen << " I> "; break; 118 119 case kWarn: fOut << kYellow << " W> "; break; 119 case kError: fOut << kRed << " E> "; break; 120 case kError: 121 case kAlarm: fOut << kRed << " E> "; break; 120 122 case kFatal: fOut << kRed << kBlink << " !> "; break; 121 123 case kDebug: fOut << kBlue << " "; break; -
trunk/FACT++/src/MessageImp.h
r13207 r14497 18 18 kWarn = 30, ///< A warning, things that somehow might result in unexpected or unwanted bahaviour 19 19 kError = 40, ///< Error, something unexpected happened, but can still be handled by the program 20 kAlarm = 45, ///< Error, something unexpected happened, but needs user intervention (i.e. it needs a signal to the user) 20 21 kFatal = 50, ///< An error which cannot be handled at all happend, the only solution is program termination 21 22 kComment = 90, ///< A comment which is always printed … … 44 45 int Warn(const std::string &str) { return Update(str, kWarn); } 45 46 int Error(const std::string &str) { return Update(str, kError); } 47 int Alarm(const std::string &str) { return Update(str, kAlarm); } 46 48 int Fatal(const std::string &str) { return Update(str, kFatal); } 47 49 int Comment(const std::string &str) { return Update(str, kComment); } … … 52 54 int Warn(const char *txt) { return Warn(std::string(txt)); } 53 55 int Error(const char *txt) { return Error(std::string(txt)); } 56 int Alarm(const char *txt) { return Alarm(std::string(txt)); } 54 57 int Fatal(const char *txt) { return Fatal(std::string(txt)); } 55 58 int Comment(const char *txt) { return Comment(std::string(txt)); } … … 59 62 int Info(const std::ostringstream &str) { return Info(str.str()); } 60 63 int Warn(const std::ostringstream &str) { return Warn(str.str()); } 64 int Alarm(const std::ostringstream &str) { return Alarm(str.str()); } 61 65 int Error(const std::ostringstream &str) { return Error(str.str()); } 62 66 int Fatal(const std::ostringstream &str) { return Fatal(str.str()); } -
trunk/FACT++/src/RemoteControl.h
r14351 r14497 167 167 virtual void JsOut(const std::string &msg) { lout << msg << endl; } 168 168 virtual void JsPrint(const std::string &msg) { if (fImp) fImp->Comment(msg.empty()?" ":msg); } 169 virtual void JsAlarm(const std::string &msg) { if (fImp) fImp->Alarm(msg.empty()?" ":msg); } 169 170 virtual void JsException(const std::string &str) { if (fImp) fImp->Error(str.empty()?" ":str); } 170 171
Note:
See TracChangeset
for help on using the changeset viewer.