class CYCData: methode addCommands added.

This commit is contained in:
Roland Jax
2014-09-28 21:01:51 +02:00
parent 3061bd09ca
commit fd6e65e7d7
2 changed files with 15 additions and 7 deletions
+13 -7
View File
@@ -27,13 +27,7 @@ extern LogInstance& L;
CYCData::CYCData(EBusLoop* ebusloop, Commands* commands)
: m_ebusloop(ebusloop), m_commands(commands), m_stop(false)
{
for (size_t index = 0; index < commands->size(); index++) {
if (strcasecmp((*m_commands)[index][0].c_str(),"cyc") == 0) {
Command* cmd = new Command(index, (*m_commands)[index]);
m_cycDB.insert(pair_t(index, cmd));
}
}
addCommands(m_commands);
}
CYCData::~CYCData()
@@ -139,3 +133,15 @@ void CYCData::storeData(int index, std::string data)
}
}
void CYCData::addCommands(Commands* commands)
{
for (size_t index = 0; index < commands->size(); index++) {
if (strcasecmp((*m_commands)[index][0].c_str(),"cyc") == 0) {
Command* cmd = new Command(index, (*m_commands)[index]);
m_cycDB.insert(pair_t(index, cmd));
}
}
L.log(cyc, trace, "%d cycle commands added", m_cycDB.size());
}
+2
View File
@@ -43,6 +43,8 @@ public:
std::string getData(int index);
void addCommands(Commands* commands);
private:
EBusLoop* m_ebusloop;
Commands* m_commands;