Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
open_class_api
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CLASS_API
open_class_api
Commits
698b0a5b
Commit
698b0a5b
authored
Sep 2, 2022
by
Querejeta Lomas, Leire
Browse files
Options
Downloads
Patches
Plain Diff
bug repair
parent
222b2629
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/api/class/src/class_core.cpp
+10
-29
10 additions, 29 deletions
src/api/class/src/class_core.cpp
src/commands.h
+4
-2
4 additions, 2 deletions
src/commands.h
src/commands.lib
+0
-0
0 additions, 0 deletions
src/commands.lib
with
14 additions
and
31 deletions
src/api/class/src/class_core.cpp
+
10
−
29
View file @
698b0a5b
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/commands.h
+
4
−
2
View file @
698b0a5b
...
...
@@ -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
;
...
...
This diff is collapsed.
Click to expand it.
src/commands.lib
+
0
−
0
View file @
698b0a5b
No preview for this file type
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment