Skip to content
Snippets Groups Projects
Commit 698b0a5b authored by Querejeta Lomas, Leire's avatar Querejeta Lomas, Leire
Browse files

bug repair

parent 222b2629
Branches
No related tags found
No related merge requests found
......@@ -644,11 +644,11 @@ ClassError::Error ClassCore::velecSelected(const int &id, const bool &selected)
if(selected)
{
return sendMsg(commands::ClassCommands::CMD_CONFIGVELEC + std::to_string(id) + commands::ClassCommands::CMD_VELEC_SELECTED + commands::ClassCommands::CMD_AUX);
return sendMsg(commands::ClassCommands::CMD_CONFIGVELEC + std::to_string(id) + commands::ClassCommands::CMD_CONFIGVELEC_PARAM4 + commands::ClassCommands::CMD_VELEC_SELECTED + commands::ClassCommands::CMD_AUX);
}
else
{
return sendMsg(commands::ClassCommands::CMD_CONFIGVELEC + std::to_string(id) + commands::ClassCommands::CMD_VELEC_NOTSELECTED + commands::ClassCommands::CMD_AUX);
return sendMsg(commands::ClassCommands::CMD_CONFIGVELEC + std::to_string(id) + commands::ClassCommands::CMD_CONFIGVELEC_PARAM4 + commands::ClassCommands::CMD_VELEC_NOTSELECTED + commands::ClassCommands::CMD_AUX);
}
}
......@@ -679,22 +679,14 @@ ClassError::Error ClassCore::velecsSelected(const std::vector<int> &id, const st
log_warn_stream_("[velecsSelected] No virtual electrode with id: " << id[velecIndex] << "configured from this client.");
}
std::stringstream ss;
ss << "velec " << id[velecIndex];
ss << " *selected ";
if (selected[velecIndex])
{
//commands::ClassCommands::CMD_CONFIGVELEC + id + commands::ClassCommands::CMD_VELEC_SELECTED + commands::ClassCommands::CMD_AUX
ss << "1";
msg_list.push_back(commands::ClassCommands::CMD_CONFIGVELEC + std::to_string(id[velecIndex]) + commands::ClassCommands::CMD_CONFIGVELEC_PARAM4 + commands::ClassCommands::CMD_VELEC_SELECTED + commands::ClassCommands::CMD_AUX);
}
else
{
//commands::ClassCommands::CMD_CONFIGVELEC + id + commands::ClassCommands::CMD_VELEC_NOTSELECTED + commands::ClassCommands::CMD_AUX
ss << "0";
msg_list.push_back(commands::ClassCommands::CMD_CONFIGVELEC + std::to_string(id[velecIndex]) + commands::ClassCommands::CMD_CONFIGVELEC_PARAM4 + commands::ClassCommands::CMD_VELEC_NOTSELECTED + commands::ClassCommands::CMD_AUX); //ss << "0";
}
ss << "\r\n";
std::string msg = ss.str();
msg_list.push_back(msg);
}
return sendMsgs(msg_list);
}
......@@ -717,11 +709,8 @@ ClassError::Error ClassCore::stimVelec(const std::string &name)
log_warn_stream_("[velecSelected] No virtual electrode with name: " << name << " condifgured from this client.");
}
std::stringstream ss;
ss << "stim " << name << "\r\n";
std::string msg = ss.str();
return sendMsg(commands::ClassCommands::CMD_VELECSTIM + name + commands::ClassCommands::CMD_AUX);
return sendMsg(msg);
}
ClassError::Error ClassCore::acqImpedanceConfig(const bool &positive)
......@@ -932,7 +921,7 @@ void ClassCore::udpMsgReceived(std::string msg, std::string ip)
}
}
}
else if (msg.find("velec ") != std::string::npos)
else if (msg.find("velec ") != std::string::npos && (msg.find("*name ") == std::string::npos))
{
double is_waiting_velecstatus = false;
if (velecstatus_mutex_.try_lock())
......@@ -1419,11 +1408,8 @@ ClassError::Error ClassCore::logeventsStatus()
ClassError::Error ClassCore::velecStatus(const int &number)
{
std::stringstream ss;
ss << "velec " << number << " ?\r\n";
std::string msg = ss.str();
ClassError::Error response = sendMsg(msg);
ClassError::Error response = sendMsg(commands::ClassCommands::CMD_CONFIGVELEC + std::to_string(number) + commands::ClassCommands::CMD_AUX);
if (velecstatus_mutex_.try_lock())
{
......@@ -1436,12 +1422,7 @@ ClassError::Error ClassCore::velecStatus(const int &number)
ClassError::Error ClassCore::patternStatus(const int &number)
{
std::stringstream ss;
ss << "pattern " << number << " ?\r\n";
std::string msg = ss.str();
ClassError::Error response = sendMsg(msg);
ClassError::Error response = sendMsg(commands::ClassCommands::CMD_CONFIGPATTERN + std::to_string(number) + commands::ClassCommands::CMD_AUX2 + commands::ClassCommands::CMD_AUX);
if (patternstatus_mutex_.try_lock())
{
is_waiting_patternstatus_ = true;
......
......@@ -21,6 +21,7 @@ namespace commands
static std::string ClassCommands::CMD_CONFIGACQ_PARAM1;
static std::string ClassCommands::CMD_CONFIGACQ_PARAM2;
static std::string ClassCommands::CMD_CONFIGACQ_PARAM3;
static std::string ClassCommands::CMD_CONFIGVELEC_PARAM4;
static std::string ClassCommands::CMD_VELEC_SELECTED;
static std::string ClassCommands::CMD_VELEC_NOTSELECTED;
......@@ -28,6 +29,7 @@ namespace commands
static std::string ClassCommands::CMD_ONSTIM;
static std::string ClassCommands::CMD_OFFSTIM;
static std::string ClassCommands::CMD_VELECSTIM;
static std::string ClassCommands::CMD_CONFIGELEC;
......@@ -77,7 +79,7 @@ namespace commands
static std::string ClassCommands::CMD_GETDEVICENAME;
static std::string ClassCommands::CMD_GETLOGEVENTS;
//velec
//pattern
static std::string ClassCommands::CMD_GETPATTERN;
static std::string ClassCommands::CMD_GETHV;
static std::string ClassCommands::CMD_GETINTERVAL;
static std::string ClassCommands::CMD_GETRTC;
......@@ -91,7 +93,7 @@ namespace commands
static std::string ClassCommands::CMD_BUFFERFLUSH;
static std::string ClassCommands::CMD_AUX;
static std::string ClassCommands::CMD_AUX2;
......
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment