Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
sot-core
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
sot-core
Commits
d81f9025
Commit
d81f9025
authored
11 years ago
by
Francois Keith
Browse files
Options
Downloads
Patches
Plain Diff
Update Reader: add the python interface, remove the old one.
parent
b3fd9905
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/sot/core/reader.hh
+2
-3
2 additions, 3 deletions
include/sot/core/reader.hh
src/traces/reader.cpp
+23
-36
23 additions, 36 deletions
src/traces/reader.cpp
with
25 additions
and
39 deletions
include/sot/core/reader.hh
+
2
−
3
View file @
d81f9025
...
...
@@ -96,13 +96,12 @@ class SOTREADER_EXPORT sotReader
ml
::
Vector
&
getNextData
(
ml
::
Vector
&
res
,
const
unsigned
int
time
);
ml
::
Matrix
&
getNextMatrix
(
ml
::
Matrix
&
res
,
const
unsigned
int
time
);
void
resize
(
const
int
&
nbRow
,
const
int
&
nbCol
);
public
:
/* --- PARAMS --- */
void
display
(
std
::
ostream
&
os
)
const
;
virtual
void
commandLine
(
const
std
::
string
&
cmdLine
,
std
::
istringstream
&
cmdArgs
,
std
::
ostream
&
os
);
virtual
void
initCommands
();
};
...
...
This diff is collapsed.
Click to expand it.
src/traces/reader.cpp
+
23
−
36
View file @
d81f9025
...
...
@@ -29,6 +29,7 @@
#include
<boost/bind.hpp>
#include
<sstream>
#include
<dynamic-graph/factory.h>
#include
<dynamic-graph/all-commands.h>
using
namespace
dynamicgraph
;
using
namespace
dynamicgraph
::
sot
;
...
...
@@ -57,6 +58,8 @@ sotReader::sotReader( const std::string n )
signalRegistration
(
selectionSIN
<<
vectorSOUT
<<
matrixSOUT
);
selectionSIN
=
true
;
vectorSOUT
.
setNeedUpdateFromAllChildren
(
true
);
initCommands
();
}
/* --------------------------------------------------------------------- */
...
...
@@ -177,42 +180,26 @@ std::ostream& operator<< ( std::ostream& os,const sotReader& t )
return
os
;
}
void
sotReader
::
commandLine
(
const
std
::
string
&
cmdLine
,
std
::
istringstream
&
cmdArgs
,
std
::
ostream
&
os
)
/* --- Command line interface ------------------------------------------------------ */
void
sotReader
::
initCommands
()
{
if
(
cmdLine
==
"help"
)
{
os
<<
"Reader: "
<<
endl
<<
" - load"
<<
endl
;
Entity
::
commandLine
(
cmdLine
,
cmdArgs
,
os
);
}
else
if
(
cmdLine
==
"load"
)
{
string
filename
;
cmdArgs
>>
ws
>>
filename
;
load
(
filename
);
}
else
if
(
cmdLine
==
"rewind"
)
{
cmdArgs
>>
ws
;
rewind
(
);
}
else
if
(
cmdLine
==
"clear"
)
{
cmdArgs
>>
ws
;
clear
(
);
}
else
if
(
cmdLine
==
"resize"
)
{
cmdArgs
>>
ws
;
if
(
cmdArgs
.
good
()
)
{
cmdArgs
>>
nbRows
>>
nbCols
;
}
else
{
os
<<
"Matrix size = "
<<
nbRows
<<
" x "
<<
nbCols
<<
std
::
endl
;
}
}
else
{
Entity
::
commandLine
(
cmdLine
,
cmdArgs
,
os
);
}
namespace
dc
=
::
dynamicgraph
::
command
;
addCommand
(
"clear"
,
dc
::
makeCommandVoid0
(
*
this
,
&
sotReader
::
clear
,
"Clear the data loaded"
));
addCommand
(
"rewind"
,
dc
::
makeCommandVoid0
(
*
this
,
&
sotReader
::
rewind
,
"Reset the iterator to the beginning of the data set"
));
addCommand
(
"load"
,
dc
::
makeCommandVoid1
(
*
this
,
&
sotReader
::
load
,
"load file"
));
addCommand
(
"resize"
,
dc
::
makeCommandVoid2
(
*
this
,
&
sotReader
::
resize
,
" "
));
}
void
sotReader
::
resize
(
const
int
&
nbRow
,
const
int
&
nbCol
)
{
nbRows
=
nbRow
;
nbCols
=
nbCol
;
}
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