Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
CGoGN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
CGoGN
CGoGN
Commits
783a4e91
Commit
783a4e91
authored
Apr 01, 2015
by
Sylvain Thery
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
upgrade python recording
parent
dad3b8ae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
6 deletions
+49
-6
SCHNApps/include/plugin.h
SCHNApps/include/plugin.h
+21
-0
SCHNApps/include/schnapps.h
SCHNApps/include/schnapps.h
+4
-1
SCHNApps/src/schnapps.cpp
SCHNApps/src/schnapps.cpp
+24
-5
No files found.
SCHNApps/include/plugin.h
View file @
783a4e91
...
...
@@ -96,7 +96,10 @@ void Plugin::pythonRecording(QString slotName, QString returned, T1 param1)
if
(
rec
)
{
if
(
!
returned
.
isEmpty
())
{
m_schnapps
->
pythonVarDeclare
(
returned
);
*
rec
<<
returned
<<
" = "
;
}
*
rec
<<
this
->
getName
()
<<
"."
<<
slotName
<<
"("
<<
pyR_stringify
(
param1
)
<<
");"
<<
endl
;
}
}
...
...
@@ -108,7 +111,10 @@ void Plugin::pythonRecording(QString slotName, QString returned, T1 param1, T2 p
if
(
rec
)
{
if
(
!
returned
.
isEmpty
())
{
m_schnapps
->
pythonVarDeclare
(
returned
);
*
rec
<<
returned
<<
" = "
;
}
*
rec
<<
this
->
getName
()
<<
"."
<<
slotName
<<
"("
<<
pyR_stringify
(
param1
)
<<
", "
<<
pyR_stringify
(
param2
)
<<
");"
<<
endl
;
}
}
...
...
@@ -120,7 +126,10 @@ void Plugin::pythonRecording(QString slotName, QString returned, T1 param1, T2 p
if
(
rec
)
{
if
(
!
returned
.
isEmpty
())
{
m_schnapps
->
pythonVarDeclare
(
returned
);
*
rec
<<
returned
<<
" = "
;
}
*
rec
<<
this
->
getName
()
<<
"."
<<
slotName
<<
"("
<<
pyR_stringify
(
param1
)
<<
", "
<<
pyR_stringify
(
param2
)
<<
", "
<<
pyR_stringify
(
param3
)
<<
");"
<<
endl
;
}
}
...
...
@@ -133,7 +142,10 @@ void Plugin::pythonRecording(QString slotName, QString returned, T1 param1, T2 p
if
(
rec
)
{
if
(
!
returned
.
isEmpty
())
{
m_schnapps
->
pythonVarDeclare
(
returned
);
*
rec
<<
returned
<<
" = "
;
}
*
rec
<<
this
->
getName
()
<<
"."
<<
slotName
<<
"("
<<
pyR_stringify
(
param1
)
<<
", "
<<
pyR_stringify
(
param2
)
<<
", "
<<
pyR_stringify
(
param3
)
<<
", "
<<
pyR_stringify
(
param4
)
<<
");"
<<
endl
;
}
}
...
...
@@ -145,7 +157,10 @@ void Plugin::pythonRecording(QString slotName, QString returned, T1 param1, T2 p
if
(
rec
)
{
if
(
!
returned
.
isEmpty
())
{
m_schnapps
->
pythonVarDeclare
(
returned
);
*
rec
<<
returned
<<
" = "
;
}
*
rec
<<
this
->
getName
()
<<
"."
<<
slotName
<<
"("
<<
pyR_stringify
(
param1
)
<<
", "
<<
pyR_stringify
(
param2
)
<<
", "
;
*
rec
<<
pyR_stringify
(
param3
)
<<
", "
<<
pyR_stringify
(
param4
)
<<
", "
<<
pyR_stringify
(
param5
)
<<
");"
<<
endl
;
}
...
...
@@ -159,7 +174,10 @@ void Plugin::pythonRecording(QString slotName, QString returned, T1 param1, T2 p
if
(
rec
)
{
if
(
!
returned
.
isEmpty
())
{
m_schnapps
->
pythonVarDeclare
(
returned
);
*
rec
<<
returned
<<
" = "
;
}
*
rec
<<
this
->
getName
()
<<
"."
<<
slotName
<<
"("
<<
pyR_stringify
(
param1
)
<<
", "
<<
pyR_stringify
(
param2
)
<<
", "
;
*
rec
<<
pyR_stringify
(
param3
)
<<
", "
<<
pyR_stringify
(
param4
)
<<
", "
<<
pyR_stringify
(
param5
)
<<
", "
<<
pyR_stringify
(
param6
)
<<
");"
<<
endl
;
}
...
...
@@ -174,7 +192,10 @@ void Plugin::pythonRecording(QString slotName, QString returned, T1 param1, T2 p
if
(
rec
)
{
if
(
!
returned
.
isEmpty
())
{
m_schnapps
->
pythonVarDeclare
(
returned
);
*
rec
<<
returned
<<
" = "
;
}
*
rec
<<
this
->
getName
()
<<
"."
<<
slotName
<<
"("
<<
pyR_stringify
(
param1
)
<<
", "
<<
pyR_stringify
(
param2
)
<<
", "
;
*
rec
<<
pyR_stringify
(
param3
)
<<
", "
<<
pyR_stringify
(
param4
)
<<
", "
<<
pyR_stringify
(
param5
)
<<
", "
;
*
rec
<<
pyR_stringify
(
param6
)
<<
", "
<<
pyR_stringify
(
param7
)
<<
", "
<<
pyR_stringify
(
param8
)
<<
", "
;
...
...
SCHNApps/include/schnapps.h
View file @
783a4e91
...
...
@@ -156,6 +156,8 @@ private slots:
protected:
QTextStream
*
m_pyRecording
;
QFile
*
m_pyRecFile
;
QList
<
QString
>
m_pyVarNames
;
QString
m_pyBuffer
;
private
slots
:
void
beginPyRecording
();
...
...
@@ -164,7 +166,8 @@ private slots:
public:
inline
QTextStream
*
pythonStreamRecorder
()
{
return
m_pyRecording
;
}
inline
void
pythonVarDeclare
(
const
QString
&
var
)
{
m_pyVarNames
.
push_back
(
var
);
}
inline
void
pythonVarsClear
()
{
m_pyVarNames
.
clear
();
}
signals:
void
cameraAdded
(
Camera
*
camera
);
...
...
SCHNApps/src/schnapps.cpp
View file @
783a4e91
...
...
@@ -839,7 +839,11 @@ void SCHNApps::beginPyRecording()
if
(
m_pyRecording
!=
NULL
)
// WRITE & CLOSE
{
QTextStream
out
(
m_pyRecFile
);
out
<<
m_pyRecording
->
readAll
();
foreach
(
QString
var
,
m_pyVarNames
)
{
m_pyBuffer
.
replace
(
"
\"
"
+
var
+
"
\"
"
,
var
+
".getName()"
);
}
out
<<
m_pyBuffer
<<
endl
;
m_pyRecFile
->
close
();
delete
m_pyRecording
;
...
...
@@ -856,7 +860,10 @@ void SCHNApps::beginPyRecording()
m_pyRecFile
=
new
QFile
(
fileName
);
if
(
!
m_pyRecFile
->
open
(
QIODevice
::
WriteOnly
|
QIODevice
::
Text
))
return
;
m_pyRecording
=
new
QTextStream
(
m_pyRecFile
);
m_pyBuffer
.
clear
();
m_pyRecording
=
new
QTextStream
(
&
m_pyBuffer
);
foreach
(
View
*
v
,
m_views
)
*
m_pyRecording
<<
v
->
getName
()
<<
" = schnapps.getView(
\"
"
<<
v
->
getName
()
<<
"
\"
);"
<<
endl
;
...
...
@@ -865,6 +872,7 @@ void SCHNApps::beginPyRecording()
*
m_pyRecording
<<
m
->
getName
()
<<
" = schnapps.getMap(
\"
"
<<
m
->
getName
()
<<
"
\"
);"
<<
endl
;
statusbar
->
showMessage
(
QString
(
" Recording python in "
)
+
fileName
);
pythonVarsClear
();
}
else
{
...
...
@@ -880,7 +888,11 @@ void SCHNApps::appendPyRecording()
if
(
m_pyRecording
!=
NULL
)
// WRITE & CLOSE
{
QTextStream
out
(
m_pyRecFile
);
out
<<
m_pyRecording
->
readAll
();
foreach
(
QString
var
,
m_pyVarNames
)
{
m_pyBuffer
.
replace
(
"
\"
"
+
var
+
"
\"
"
,
var
+
".getName()"
);
}
out
<<
m_pyBuffer
<<
endl
;
m_pyRecFile
->
close
();
delete
m_pyRecording
;
...
...
@@ -897,15 +909,22 @@ void SCHNApps::appendPyRecording()
m_pyRecFile
=
new
QFile
(
fileName
);
if
(
!
m_pyRecFile
->
open
(
QIODevice
::
Append
|
QIODevice
::
Text
))
return
;
m_pyRecording
=
new
QTextStream
(
m_pyRecFile
);
m_pyBuffer
.
clear
();
m_pyRecording
=
new
QTextStream
(
&
m_pyBuffer
);
pythonVarsClear
();
foreach
(
View
*
v
,
m_views
)
*
m_pyRecording
<<
v
->
getName
()
<<
" = schnapps.getView(
\"
"
<<
v
->
getName
()
<<
"
\"
);"
<<
endl
;
foreach
(
MapHandlerGen
*
m
,
m_maps
)
*
m_pyRecording
<<
m
->
getName
()
<<
" = schnapps.getMap(
\"
"
<<
m
->
getName
()
<<
"
\"
);"
<<
endl
;
{
*
m_pyRecording
<<
m
->
getName
()
<<
" = schnapps.getMap(
\"
"
<<
m
->
getName
()
<<
"
\"
); #replace by = previous_var if appending"
<<
endl
;
pythonVarDeclare
(
m
->
getName
());
}
statusbar
->
showMessage
(
QString
(
" Append recording python in "
)
+
fileName
);
}
else
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment