Changeset 14559 for trunk/FACT++
- Timestamp:
- 11/05/12 12:02:57 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/RemoteControl.h
r14554 r14559 162 162 // ============ Pseudo-callback interface for the JavaScrip engine ======= 163 163 164 virtual void JsLoad(const std::string &) { SetSection(-2); } 165 virtual void JsStart(const std::string &) { SetSection(-1); } 166 virtual void JsEnd(const std::string &) { UnsubscribeAll(); SetSection(-3); } 167 virtual bool JsSend(const std::string &str) { return ProcessCommand(str); } 168 virtual void JsOut(const std::string &msg) { lin << msg << endl; } 169 virtual void JsPrint(const std::string &msg) { if (fImp) fImp->Comment(msg.empty()?" ":msg); } 170 virtual void JsAlarm(const std::string &msg) { if (fImp) fImp->Alarm(msg.empty()?" ":msg); } 171 virtual void JsException(const std::string &str) { if (fImp) fImp->Error(str.empty()?" ":str); } 172 173 State JsState(const std::string &server) 174 { 175 return fImp ? fImp->GetServerState(server) : State(-256, string()); 176 } 164 void JsLoad(const std::string &) { SetSection(-3); } 165 void JsStart(const std::string &) { SetSection(-2); } 166 void JsEnd(const std::string &) { UnsubscribeAll(); SetSection(-4); } 167 bool JsSend(const std::string &str) { return ProcessCommand(str); } 168 void JsOut(const std::string &msg) { lin << msg << endl; } 169 void JsPrint(const std::string &msg) { if (fImp) fImp->Comment(msg.empty()?" ":msg); } 170 void JsAlarm(const std::string &msg) { if (fImp) fImp->Alarm(msg.empty()?" ":msg); } 171 void JsException(const std::string &str) { if (fImp) fImp->Error(str.empty()?" ":str); } 172 bool JsHasState(int s) const { return fImp && fImp->HasState(s); } 173 bool JsHasState(const string &n) const { return fImp && (fImp->GetStateIndex(n)!=StateMachineImp::kSM_NotAvailable); } 174 bool JsSetState(int s) { if (!fImp || fImp->GetCurrentState()<2) return false; SetSection(s-4); return true; } 175 int JsGetState(const string &n) const { return fImp ? fImp->GetStateIndex(n) : StateMachineImp::kSM_NotAvailable; } 176 State JsState(const std::string &server) { return fImp ? fImp->GetServerState(server) : State(-256, string()); } 177 bool JsNewState(int s, const string &n, const string &c) 178 { 179 return fImp && fImp->AddStateName(s, n, c); 180 } 181 177 182 178 183 /*
Note:
See TracChangeset
for help on using the changeset viewer.