Commit 0cbafe19 authored by yannick legoc's avatar yannick legoc
Browse files

added test command to DielectricsMatlab

parent 2177b9e6
...@@ -45,7 +45,7 @@ const std::string RemoteMatlabReq::RUN_SPECTRUMS_TIME = "Run Spectrums Time"; ...@@ -45,7 +45,7 @@ const std::string RemoteMatlabReq::RUN_SPECTRUMS_TIME = "Run Spectrums Time";
const std::string RemoteMatlabReq::RUN_SINGLE_FREQUENCY = "Run Single Frequency"; const std::string RemoteMatlabReq::RUN_SINGLE_FREQUENCY = "Run Single Frequency";
RemoteMatlabReq::RemoteMatlabReq(const std::string& name) : RemoteMatlabReq::RemoteMatlabReq(const std::string& name) :
ExperimentController(name), controller::Start(this), controller::Raz(this) { ExperimentController(name), controller::Start(this), controller::Raz(this), Test(this) {
setFamily(family::ACQUISITION); setFamily(family::ACQUISITION);
...@@ -89,7 +89,7 @@ RemoteMatlabReq::RemoteMatlabReq(const std::string& name) : ...@@ -89,7 +89,7 @@ RemoteMatlabReq::RemoteMatlabReq(const std::string& name) :
} }
RemoteMatlabReq::RemoteMatlabReq(const RemoteMatlabReq& controller) : RemoteMatlabReq::RemoteMatlabReq(const RemoteMatlabReq& controller) :
ExperimentController(controller), controller::Start(this), controller::Raz(this) { ExperimentController(controller), controller::Start(this), controller::Raz(this), Test(this) {
} }
RemoteMatlabReq::~RemoteMatlabReq() { RemoteMatlabReq::~RemoteMatlabReq() {
...@@ -256,6 +256,14 @@ void RemoteMatlabReq::raz() { ...@@ -256,6 +256,14 @@ void RemoteMatlabReq::raz() {
initialized = false; initialized = false;
} }
void RemoteMatlabReq::test() {
for (int i = 0; i < 100; ++i) {
raz();
initApplication();
}
}
void RemoteMatlabReq::stopRun() { void RemoteMatlabReq::stopRun() {
auto_ptr<cameo::application::Instance> matlabStopApplication = m_server->start(MATLAB_STOP_APPLICATION); auto_ptr<cameo::application::Instance> matlabStopApplication = m_server->start(MATLAB_STOP_APPLICATION);
......
...@@ -24,9 +24,26 @@ ...@@ -24,9 +24,26 @@
namespace dielectrics { namespace dielectrics {
/*!
* \brief Test command.
*/
class Test: private controller::Command {
public:
Test(ExperimentController * c) :
controller::Command(c, "test", &Test::test, this) {
}
virtual void test() = 0;
void testCommand(bool logging = false) {
command(logging, true);
}
};
class RemoteMatlabReq : public ExperimentController, class RemoteMatlabReq : public ExperimentController,
public controller::Start, public controller::Start,
public controller::Raz { public controller::Raz,
public Test {
public: public:
//! Type of controller //! Type of controller
...@@ -40,6 +57,7 @@ public: ...@@ -40,6 +57,7 @@ public:
virtual void start(); virtual void start();
virtual void raz(); virtual void raz();
virtual void test();
void stopRun(); void stopRun();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment