#ifndef INCLUDED_LogTestMachine_h_
#define INCLUDED_LogTestMachine_h_
#include "Behaviors/StateMachine.h"
#include "Behaviors/Controls/EventLogger.h"
#include "Events/EventRouter.h"
#include "Shared/ProjectInterface.h"
#include "Sound/SoundManager.h"
#include "Vision/JPEGGenerator.h"
class Message : public StateNode {
public:
Message() : StateNode("Message") {}
virtual void DoStart() {
std::string const msg = "Hooray for Captain Spaulding!";
EventLogger::logMessage(msg,this);
}
};
class Image : public StateNode {
public:
Image() : StateNode("Image") {}
virtual void DoStart() {
EventLogger::logImage(*ProjectInterface::defColorJPEGGenerator,ProjectInterface::fullLayer,0,this);
sndman->PlayFile("camera.wav");
}
};
class Webcam : public StateNode {
public:
Webcam() : StateNode("Webcam") {}
virtual void DoStart() {
EventLogger::logWebcam(this);
}
};
class LogTestMachine : public StateNode {
public:
LogTestMachine() : StateNode("LogTestMachine") {}
virtual void setup() {
#statemachine
waiting: StateNode
waiting >== TextMsgTrans($,$$,"message")==> Message() =N=> waiting
waiting >== TextMsgTrans($,$$,"image")==> Image() =N=> waiting
waiting >== TextMsgTrans($,$$,"webcam")==> WebCam() =N=> waiting
| #endstatemachine
startnode = waiting;
}
protected: // Dummy functions to satisfy the compiler
LogTestMachine(const LogTestMachine&);
LogTestMachine& operator=(const LogTestMachine&);
};
#endif
|