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
K
kumir2
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2
Issues
2
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
kumir
kumir2
Commits
2e922e27
Commit
2e922e27
authored
Oct 14, 2020
by
Alexander A. Maly
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Astyling IsometricRobot
parent
72a6dc3f
Pipeline
#2518
failed with stages
in 2 minutes and 6 seconds
Changes
31
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
2852 additions
and
2671 deletions
+2852
-2671
src/actors/isometricrobot/cellgraphicsitem.cpp
src/actors/isometricrobot/cellgraphicsitem.cpp
+29
-30
src/actors/isometricrobot/cellgraphicsitem.h
src/actors/isometricrobot/cellgraphicsitem.h
+30
-33
src/actors/isometricrobot/fp.h
src/actors/isometricrobot/fp.h
+22
-22
src/actors/isometricrobot/graphicsimageitem.cpp
src/actors/isometricrobot/graphicsimageitem.cpp
+26
-22
src/actors/isometricrobot/graphicsimageitem.h
src/actors/isometricrobot/graphicsimageitem.h
+13
-16
src/actors/isometricrobot/isometricrobotmodule.cpp
src/actors/isometricrobot/isometricrobotmodule.cpp
+139
-143
src/actors/isometricrobot/isometricrobotmodule.h
src/actors/isometricrobot/isometricrobotmodule.h
+51
-50
src/actors/isometricrobot/remotecontrol.h
src/actors/isometricrobot/remotecontrol.h
+65
-52
src/actors/isometricrobot/robot25dwindow.cpp
src/actors/isometricrobot/robot25dwindow.cpp
+138
-136
src/actors/isometricrobot/robot25dwindow.h
src/actors/isometricrobot/robot25dwindow.h
+44
-30
src/actors/isometricrobot/robotcell.h
src/actors/isometricrobot/robotcell.h
+32
-37
src/actors/isometricrobot/roboterrors.h
src/actors/isometricrobot/roboterrors.h
+6
-7
src/actors/isometricrobot/robotitem.cpp
src/actors/isometricrobot/robotitem.cpp
+292
-287
src/actors/isometricrobot/robotitem.h
src/actors/isometricrobot/robotitem.h
+59
-56
src/actors/isometricrobot/robotmodel.h
src/actors/isometricrobot/robotmodel.h
+59
-58
src/actors/isometricrobot/robotview.cpp
src/actors/isometricrobot/robotview.cpp
+582
-573
src/actors/isometricrobot/robotview.h
src/actors/isometricrobot/robotview.h
+78
-66
src/actors/isometricrobot/sch_algorithm.cpp
src/actors/isometricrobot/sch_algorithm.cpp
+125
-114
src/actors/isometricrobot/sch_algorithm.h
src/actors/isometricrobot/sch_algorithm.h
+15
-15
src/actors/isometricrobot/sch_command.cpp
src/actors/isometricrobot/sch_command.cpp
+182
-99
src/actors/isometricrobot/sch_command.h
src/actors/isometricrobot/sch_command.h
+30
-29
src/actors/isometricrobot/sch_environment.cpp
src/actors/isometricrobot/sch_environment.cpp
+356
-350
src/actors/isometricrobot/sch_environment.h
src/actors/isometricrobot/sch_environment.h
+23
-20
src/actors/isometricrobot/sch_game.cpp
src/actors/isometricrobot/sch_game.cpp
+121
-115
src/actors/isometricrobot/sch_game.h
src/actors/isometricrobot/sch_game.h
+14
-13
src/actors/isometricrobot/sch_program.cpp
src/actors/isometricrobot/sch_program.cpp
+39
-35
src/actors/isometricrobot/sch_program.h
src/actors/isometricrobot/sch_program.h
+1
-1
src/actors/isometricrobot/sch_task.cpp
src/actors/isometricrobot/sch_task.cpp
+121
-111
src/actors/isometricrobot/sch_task.h
src/actors/isometricrobot/sch_task.h
+12
-13
src/actors/isometricrobot/util.cpp
src/actors/isometricrobot/util.cpp
+144
-128
src/actors/isometricrobot/util.h
src/actors/isometricrobot/util.h
+4
-10
No files found.
src/actors/isometricrobot/cellgraphicsitem.cpp
View file @
2e922e27
...
...
@@ -4,41 +4,40 @@
#include "robotitem.h"
#include "util.h"
#define NO_WALL_OPACITY 0.5
#define WALL_OPACITY 0.8
namespace
Robot25D
{
CellGraphicsItem
::
CellGraphicsItem
(
const
QPolygonF
&
poly
,
const
QPolygonF
&
polySouth
,
const
QPolygonF
&
polyEast
,
const
QPolygonF
&
polyNorth
,
const
QPolygonF
&
polyWest
,
bool
editable
,
int
cellX
,
int
cellY
,
RobotView
*
view
,
QGraphicsItem
*
parent
)
:
QGraphicsPolygonItem
(
poly
,
parent
)
,
p_south
(
polySouth
)
,
p_east
(
polyEast
)
,
p_north
(
polyNorth
)
,
p_west
(
polyWest
)
,
i_cellX
(
cellX
)
,
i_cellY
(
cellY
)
,
m_view
(
view
)
namespace
Robot25D
{
CellGraphicsItem
::
CellGraphicsItem
(
const
QPolygonF
&
poly
,
const
QPolygonF
&
polySouth
,
const
QPolygonF
&
polyEast
,
const
QPolygonF
&
polyNorth
,
const
QPolygonF
&
polyWest
,
bool
editable
,
int
cellX
,
int
cellY
,
RobotView
*
view
,
QGraphicsItem
*
parent
)
:
QGraphicsPolygonItem
(
poly
,
parent
),
p_south
(
polySouth
),
p_east
(
polyEast
),
p_north
(
polyNorth
),
p_west
(
polyWest
),
i_cellX
(
cellX
),
i_cellY
(
cellY
),
m_view
(
view
)
{
}
void
CellGraphicsItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
{
QGraphicsPolygonItem
::
paint
(
painter
,
option
,
widget
);
void
CellGraphicsItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
{
QGraphicsPolygonItem
::
paint
(
painter
,
option
,
widget
);
}
}
}
// namespace Robot25D
src/actors/isometricrobot/cellgraphicsitem.h
View file @
2e922e27
#ifndef CELLGRAPHICSITEM_H
#define CELLGRAPHICSITEM_H
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QGraphicsPolygonItem>
namespace
Robot25D
{
namespace
Robot25D
{
class
RobotView
;
class
CellGraphicsItem
:
public
QGraphicsPolygonItem
class
CellGraphicsItem
:
public
QGraphicsPolygonItem
{
public:
CellGraphicsItem
(
const
QPolygonF
&
poly
,
const
QPolygonF
&
polySouth
,
const
QPolygonF
&
polyEast
,
const
QPolygonF
&
polyNorth
,
const
QPolygonF
&
polyWest
,
bool
editable
,
int
cellX
,
int
cellY
,
RobotView
*
view
,
QGraphicsItem
*
parent
=
0
);
protected:
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
private:
int
whichWall
(
const
QPointF
&
p
)
const
;
QPolygonF
p_south
;
QPolygonF
p_east
;
QPolygonF
p_north
;
QPolygonF
p_west
;
bool
b_editable
;
int
i_cellX
;
int
i_cellY
;
RobotView
*
m_view
;
CellGraphicsItem
(
const
QPolygonF
&
poly
,
const
QPolygonF
&
polySouth
,
const
QPolygonF
&
polyEast
,
const
QPolygonF
&
polyNorth
,
const
QPolygonF
&
polyWest
,
bool
editable
,
int
cellX
,
int
cellY
,
RobotView
*
view
,
QGraphicsItem
*
parent
=
0
);
protected:
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
private:
//int whichWall(const QPointF &p) const;
QPolygonF
p_south
;
QPolygonF
p_east
;
QPolygonF
p_north
;
QPolygonF
p_west
;
bool
b_editable
;
int
i_cellX
;
int
i_cellY
;
RobotView
*
m_view
;
};
}
}
// namespace Robot25D
#endif // CELLGRAPHICSITEM_H
src/actors/isometricrobot/fp.h
View file @
2e922e27
#ifndef FP_H
#define FP_H
#include <Q
tCore
>
#include <Q
List
>
template
<
typename
T
,
typename
R
>
extern
inline
QList
<
R
>
MAP
(
R
(
*
function
)(
const
T
&
),
const
QList
<
T
>
&
iterable
)
template
<
typename
T
,
typename
R
>
extern
inline
QList
<
R
>
MAP
(
R
(
*
function
)(
const
T
&
),
const
QList
<
T
>
&
iterable
)
{
QList
<
R
>
result
;
for
(
int
i
=
0
;
i
<
iterable
.
size
();
i
++
)
{
result
<<
(
*
function
)(
iterable
[
i
]);
}
return
result
;
QList
<
R
>
result
;
for
(
int
i
=
0
;
i
<
iterable
.
size
();
i
++
)
{
result
<<
(
*
function
)(
iterable
[
i
]);
}
return
result
;
}
template
<
typename
T
>
extern
inline
T
REDUCE
(
T
(
*
function
)(
const
T
&
,
const
T
&
),
const
QList
<
T
>
&
iterable
)
template
<
typename
T
>
extern
inline
T
REDUCE
(
T
(
*
function
)(
const
T
&
,
const
T
&
),
const
QList
<
T
>
&
iterable
)
{
Q_ASSERT
(
!
iterable
.
isEmpty
());
T
result
=
iterable
.
first
();
for
(
int
i
=
1
;
i
<
iterable
.
size
();
i
++
)
{
result
=
(
*
function
)(
result
,
iterable
[
i
]);
}
return
result
;
Q_ASSERT
(
!
iterable
.
isEmpty
());
T
result
=
iterable
.
first
();
for
(
int
i
=
1
;
i
<
iterable
.
size
();
i
++
)
{
result
=
(
*
function
)(
result
,
iterable
[
i
]);
}
return
result
;
}
template
<
typename
T
>
extern
inline
QList
<
T
>
FILTER
(
bool
(
*
function
)(
const
T
&
),
const
QList
<
T
>
&
iterable
)
template
<
typename
T
>
extern
inline
QList
<
T
>
FILTER
(
bool
(
*
function
)(
const
T
&
),
const
QList
<
T
>
&
iterable
)
{
QList
<
T
>
result
;
for
(
int
i
=
0
;
i
<
iterable
.
size
();
i
++
)
{
if
((
*
function
)(
iterable
[
i
]))
{
result
<<
iterable
[
i
];
}
}
return
result
;
QList
<
T
>
result
;
for
(
int
i
=
0
;
i
<
iterable
.
size
();
i
++
)
{
if
((
*
function
)(
iterable
[
i
]))
{
result
<<
iterable
[
i
];
}
}
return
result
;
}
#endif // FP_H
src/actors/isometricrobot/graphicsimageitem.cpp
View file @
2e922e27
#include "graphicsimageitem.h"
#include <QMutex>
#include <QPainter>
namespace
Robot25D
{
namespace
Robot25D
{
GraphicsImageItem
::
GraphicsImageItem
()
{
_mutex_image
=
new
QMutex
;
_mutex_image
=
new
QMutex
;
}
QRectF
GraphicsImageItem
::
boundingRect
()
const
{
_mutex_image
->
lock
();
QRectF
result
;
if
(
!
_image
.
isNull
())
result
=
QRectF
(
QPointF
(
0.0
,
0.0
),
_image
.
size
()).
adjusted
(
-
0.5
,
-
0.5
,
0.5
,
0.5
);
_mutex_image
->
unlock
();
return
result
;
_mutex_image
->
lock
();
QRectF
result
;
if
(
!
_image
.
isNull
())
{
result
=
QRectF
(
QPointF
(
0.0
,
0.0
),
_image
.
size
()).
adjusted
(
-
0.5
,
-
0.5
,
0.5
,
0.5
);
}
_mutex_image
->
unlock
();
return
result
;
}
void
GraphicsImageItem
::
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
)
{
Q_UNUSED
(
option
);
Q_UNUSED
(
widget
);
_mutex_image
->
lock
();
Q_UNUSED
(
option
);
Q_UNUSED
(
widget
);
_mutex_image
->
lock
();
// painter->setRenderHint(QPainter::SmoothPixmapTransform, true);
// bool antialiasing = scene()->views()[0]->renderHints().testFlag(QPainter::Antialiasing);
painter
->
drawImage
(
0
,
0
,
_image
);
painter
->
drawImage
(
0
,
0
,
_image
);
// painter->setPen(QColor("blue"));
// painter->drawRect(0,0,m_image.width(),m_image.height());
_mutex_image
->
unlock
();
_mutex_image
->
unlock
();
}
QImage
GraphicsImageItem
::
image
()
const
{
_mutex_image
->
lock
();
QImage
result
=
_image
;
_mutex_image
->
unlock
();
return
result
;
_mutex_image
->
lock
();
QImage
result
=
_image
;
_mutex_image
->
unlock
();
return
result
;
}
void
GraphicsImageItem
::
setImage
(
const
QImage
&
image
)
{
_mutex_image
->
lock
();
_image
=
image
;
_mutex_image
->
unlock
();
_mutex_image
->
lock
();
_image
=
image
;
_mutex_image
->
unlock
();
// update();
}
GraphicsImageItem
::~
GraphicsImageItem
()
{
delete
_mutex_image
;
delete
_mutex_image
;
}
}
}
// namespace Robot25D
src/actors/isometricrobot/graphicsimageitem.h
View file @
2e922e27
#ifndef GRAPHICSIMAGEITEM_H
#define GRAPHICSIMAGEITEM_H
#include <QtCore>
#if QT_VERSION >= 0x050000
#include <QtWidgets>
#else
#include <QtGui>
#endif
#include <QGraphicsItem>
class
QMutex
;
namespace
Robot25D
{
namespace
Robot25D
{
class
GraphicsImageItem
:
public
QGraphicsItem
{
public:
GraphicsImageItem
();
QImage
image
()
const
;
void
setImage
(
const
QImage
&
image
);
QRectF
boundingRect
()
const
;
~
GraphicsImageItem
();
GraphicsImageItem
();
QImage
image
()
const
;
void
setImage
(
const
QImage
&
image
);
QRectF
boundingRect
()
const
;
~
GraphicsImageItem
();
protected:
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
void
paint
(
QPainter
*
painter
,
const
QStyleOptionGraphicsItem
*
option
,
QWidget
*
widget
);
private:
QImage
_image
;
QMutex
*
_mutex_image
;
QImage
_image
;
QMutex
*
_mutex_image
;
};
}
}
// namespace Robot25D
#endif // GRAPHICSIMAGEITEM_H
src/actors/isometricrobot/isometricrobotmodule.cpp
View file @
2e922e27
...
...
@@ -2,267 +2,263 @@
This file is generated, but you can safely change it
until you run "gen_actor_source.py" with "--project" flag.
Generated file is just a skeleton for module contents.
Generated file is just a skeleton for module contents.
You should change it corresponding to functionality.
*/
#include <QtCore>
#include <QtGui>
#include <iostream>
#include "isometricrobotmodule.h"
#include "sch_environment.h"
#include "sch_game.h"
#include "remotecontrol.h"
namespace
ActorIsometricRobot
{
#include <QScriptEngine>
namespace
ActorIsometricRobot
{
IsometricRobotModule
::
IsometricRobotModule
(
ExtensionSystem
::
KPlugin
*
parent
)
:
IsometricRobotModuleBase
(
parent
)
,
_window
(
0
)
,
_robotView
(
0
)
,
_parentObject
(
parent
)
,
_remoteControl
(
0
)
,
_remoteControlWidget
(
0
)
{
IsometricRobotModule
::
IsometricRobotModule
(
ExtensionSystem
::
KPlugin
*
parent
)
:
IsometricRobotModuleBase
(
parent
)
,
_window
(
0
)
,
_robotView
(
0
)
,
_parentObject
(
parent
)
,
_remoteControl
(
0
)
,
_remoteControlWidget
(
0
)
{
}
void
IsometricRobotModule
::
createGui
()
{
_window
=
new
Robot25DWindow
(
_model
,
_parentObject
->
myResourcesDir
(),
0
);
_remoteControlWidget
=
new
QWidget
(
0
);
QVBoxLayout
*
rcLayout
=
new
QVBoxLayout
;
_remoteControlWidget
->
setLayout
(
rcLayout
);
const
QString
rcFileName
=
_parentObject
->
myResourcesDir
().
absoluteFilePath
(
"robot25d-rc.svg"
);
_remoteControl
=
new
SvgRemoteControl
(
_parentObject
,
this
,
rcFileName
,
_remoteControlWidget
);
rcLayout
->
addWidget
(
_remoteControl
);
_robotView
=
_window
->
robotView
();
connect
(
m_actionRobot25DLoadEnvironment
,
SIGNAL
(
triggered
()),
_window
,
SLOT
(
handleLoadAction
()));
connect
(
m_actionRobot25DResetEnvironment
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
reset
()));
_window
=
new
Robot25DWindow
(
_model
,
_parentObject
->
myResourcesDir
(),
0
);
_remoteControlWidget
=
new
QWidget
(
0
);
QVBoxLayout
*
rcLayout
=
new
QVBoxLayout
;
_remoteControlWidget
->
setLayout
(
rcLayout
);
const
QString
rcFileName
=
_parentObject
->
myResourcesDir
().
absoluteFilePath
(
"robot25d-rc.svg"
);
_remoteControl
=
new
SvgRemoteControl
(
_parentObject
,
this
,
rcFileName
,
_remoteControlWidget
);
rcLayout
->
addWidget
(
_remoteControl
);
_robotView
=
_window
->
robotView
();
connect
(
m_actionRobot25DLoadEnvironment
,
SIGNAL
(
triggered
()),
_window
,
SLOT
(
handleLoadAction
()));
connect
(
m_actionRobot25DResetEnvironment
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
reset
()));
}
QString
IsometricRobotModule
::
loadEnvironmentFromFile
(
const
QString
&
fileName
)
{
QString
message
;
QFile
f
(
fileName
);
if
(
f
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
{
QString
script
=
"a = "
;
script
+=
QString
::
fromUtf8
(
f
.
readAll
());
f
.
close
();
Schema
::
Environment
env
;
QScriptEngine
engine
;
QScriptValue
v
=
engine
.
evaluate
(
script
);
if
(
Schema
::
parceJSON
(
v
,
env
))
{
_model
->
loadEnvironment
(
env
);
}
else
{
message
=
QString
::
fromUtf8
(
"Невозможно загрузить %1: это не обстановка Вертуна"
).
arg
(
QFileInfo
(
fileName
).
fileName
());
}
}
else
{
message
=
QString
::
fromUtf8
(
"Невозможно загрузить %1: файл не читается"
).
arg
(
QFileInfo
(
fileName
).
fileName
());
}
return
message
;
QString
message
;
QFile
f
(
fileName
);
if
(
f
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
{
QString
script
=
"a = "
;
script
+=
QString
::
fromUtf8
(
f
.
readAll
());
f
.
close
();
Schema
::
Environment
env
;
QScriptEngine
engine
;
QScriptValue
v
=
engine
.
evaluate
(
script
);
if
(
Schema
::
parceJSON
(
v
,
env
))
{
_model
->
loadEnvironment
(
env
);
}
else
{
message
=
QString
::
fromUtf8
(
"Невозможно загрузить %1: это не обстановка Вертуна"
).
arg
(
QFileInfo
(
fileName
).
fileName
());
}
}
else
{
message
=
QString
::
fromUtf8
(
"Невозможно загрузить %1: файл не читается"
).
arg
(
QFileInfo
(
fileName
).
fileName
());
}
return
message
;
}
void
IsometricRobotModule
::
loadDefaultEnvironment
()
{
static
const
QString
DefaultGameFileName
=
myResourcesDir
().
absoluteFilePath
(
"default.pm.json"
);
QFile
f
(
DefaultGameFileName
);
if
(
f
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
{
QString
script
=
"a = "
;
script
+=
QString
::
fromUtf8
(
f
.
readAll
());
f
.
close
();
Schema
::
Game
g
;
QScriptEngine
engine
;
QScriptValue
v
=
engine
.
evaluate
(
script
);
if
(
Schema
::
parceJSON
(
v
,
g
))
{
Schema
::
Environment
env
=
g
.
tasks
.
first
().
environment
;
_model
->
loadEnvironment
(
env
);
}
}
static
const
QString
DefaultGameFileName
=
myResourcesDir
().
absoluteFilePath
(
"default.pm.json"
);
QFile
f
(
DefaultGameFileName
);
if
(
f
.
open
(
QIODevice
::
ReadOnly
|
QIODevice
::
Text
))
{
QString
script
=
"a = "
;
script
+=
QString
::
fromUtf8
(
f
.
readAll
());
f
.
close
();
Schema
::
Game
g
;
QScriptEngine
engine
;
QScriptValue
v
=
engine
.
evaluate
(
script
);
if
(
Schema
::
parceJSON
(
v
,
g
))
{
Schema
::
Environment
env
=
g
.
tasks
.
first
().
environment
;
_model
->
loadEnvironment
(
env
);
}
}
}
QString
IsometricRobotModule
::
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
cmdLine
)
{
if
(
!
configurationParameters
.
contains
(
"tablesOnly"
))
{
_model
=
new
Robot25D
::
RobotModel
;
if
(
!
configurationParameters
.
contains
(
"tablesOnly"
))
{
_model
=
new
Robot25D
::
RobotModel
;
bool
hasGui
=
true
;
bool
hasGui
=
true
;
#ifdef Q_OS_LINUX
hasGui
=
0
!=
getenv
(
"DISPLAY"
);
hasGui
=
0
!=
getenv
(
"DISPLAY"
);
#endif
if
(
hasGui
)
{
createGui
();
}
else
{
const
QString
envFileName
=
cmdLine
.
value
(
'e'
).
toString
();
if
(
envFileName
.
isEmpty
())
{
loadDefaultEnvironment
();
}
else
{
loadEnvironmentFromFile
(
envFileName
);
}
}
}
return
""
;
if
(
hasGui
)
{
createGui
();
}
else
{
const
QString
envFileName
=
cmdLine
.
value
(
'e'
).
toString
();
if
(
envFileName
.
isEmpty
())
{
loadDefaultEnvironment
();
}
else
{
loadEnvironmentFromFile
(
envFileName
);
}
}
}
return
""
;
}
QList
<
ExtensionSystem
::
CommandLineParameter
>
IsometricRobotModule
::
acceptableCommandLineParameters
()
{
return
QList
<
ExtensionSystem
::
CommandLineParameter
>
();
return
QList
<
ExtensionSystem
::
CommandLineParameter
>
();
}
void
IsometricRobotModule
::
reset
()
{
_model
->
reset
();
if
(
_robotView
)
{
bool
wasAnimated
=
_robotView
->
isAnimated
();
_robotView
->
reset
();
_robotView
->
setAnimated
(
wasAnimated
);
}
_model
->
reset
();
if
(
_robotView
)
{
bool
wasAnimated
=
_robotView
->
isAnimated
();
_robotView
->
reset
();
_robotView
->
setAnimated
(
wasAnimated
);
}
}
void
IsometricRobotModule
::
loadActorData
(
QIODevice
*
source
)
{
QTextStream
ts
(
source
);
ts
.
setCodec
(
"UTF-8"
);
ts
.
setAutoDetectUnicode
(
true
);
const
QString
data
=
ts
.
readAll
();
Schema
::
Environment
env
;
Schema
::
parceJSON
(
data
,
env
);
_model
->
loadEnvironment
(
env
);
QTextStream
ts
(
source
);
ts
.
setCodec
(
"UTF-8"
);
ts
.
setAutoDetectUnicode
(
true
);
const
QString
data
=
ts
.
readAll
();
Schema
::
Environment
env
;
Schema
::
parceJSON
(
data
,
env
);
_model
->
loadEnvironment
(
env
);
}
void
IsometricRobotModule
::
setAnimationEnabled
(
bool
enabled
)
{
if
(
_robotView
)
{
_robotView
->
setAnimated
(
false
);
// TODO improve me, then fix
}
if
(
_robotView
)
{
_robotView
->
setAnimated
(
false
);
// TODO improve me, then fix
}
}
QWidget
*
IsometricRobotModule
::
mainWidget
()
const
QWidget
*
IsometricRobotModule
::
mainWidget
()
const
{
return
_window
;
return
_window
;
}
void
IsometricRobotModule
::
runGoForward
()