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
3d2dd5b2
Commit
3d2dd5b2
authored
Jul 01, 2014
by
Denis Khachko
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of gitorious.org:kumir2/kumir2
Conflicts: src/actors/grasshopper/grasshoppermodule.cpp
parents
6d33598d
96113064
Changes
15
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
138 additions
and
33 deletions
+138
-33
src/actors/draw/drawmodule.cpp
src/actors/draw/drawmodule.cpp
+20
-11
src/actors/draw/drawmodule.h
src/actors/draw/drawmodule.h
+2
-0
src/actors/grasshopper/grasshoppermodule.cpp
src/actors/grasshopper/grasshoppermodule.cpp
+17
-0
src/actors/grasshopper/grasshoppermodule.h
src/actors/grasshopper/grasshoppermodule.h
+2
-0
src/actors/isometricrobot/isometricrobotmodule.cpp
src/actors/isometricrobot/isometricrobotmodule.cpp
+17
-2
src/actors/isometricrobot/isometricrobotmodule.h
src/actors/isometricrobot/isometricrobotmodule.h
+3
-0
src/actors/painter/paintermodule.cpp
src/actors/painter/paintermodule.cpp
+14
-1
src/actors/painter/paintermodule.h
src/actors/painter/paintermodule.h
+3
-1
src/actors/robot/robotmodule.cpp
src/actors/robot/robotmodule.cpp
+25
-12
src/actors/robot/robotmodule.h
src/actors/robot/robotmodule.h
+1
-0
src/actors/turtle/turtlemodule.cpp
src/actors/turtle/turtlemodule.cpp
+16
-5
src/actors/turtle/turtlemodule.h
src/actors/turtle/turtlemodule.h
+2
-0
src/actors/vodoley/vodoleymodule.cpp
src/actors/vodoley/vodoleymodule.cpp
+13
-0
src/actors/vodoley/vodoleymodule.h
src/actors/vodoley/vodoleymodule.h
+2
-0
src/app/kumir2-bc/CMakeLists.txt
src/app/kumir2-bc/CMakeLists.txt
+1
-1
No files found.
src/actors/draw/drawmodule.cpp
View file @
3d2dd5b2
...
...
@@ -744,9 +744,12 @@ void DrawView::resizeEvent ( QResizeEvent * event )
DrawModule
::
DrawModule
(
ExtensionSystem
::
KPlugin
*
parent
)
:
DrawModuleBase
(
parent
)
{
CurView
=
0
;
}
void
DrawModule
::
createGui
()
{
CurView
=
new
DrawView
();
netStepX
=
1
;
netStepY
=
1
;
...
...
@@ -758,19 +761,19 @@ DrawModule::DrawModule(ExtensionSystem::KPlugin * parent)
showToolsBut
=
new
QToolButton
(
CurView
);
showToolsBut
->
move
(
20
,
20
);
showToolsBut
->
setCheckable
(
true
);
connect
(
showToolsBut
,
SIGNAL
(
toggled
(
bool
)),
this
,
SLOT
(
showNavigator
(
bool
)));
connect
(
m_actionDrawSaveDrawing
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
saveFile
()));
connect
(
m_actionDrawLoadDrawing
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
openFile
()));
navigator
->
setDraw
(
this
);
navigator
->
setParent
(
CurView
);
navigator
->
setFixedSize
(
QSize
(
130
,
200
));
navigator
->
move
(
20
,
showToolsBut
->
pos
().
y
()
+
showToolsBut
->
height
());
navigator
->
hide
();
CurScene
->
setDraw
(
this
);
CurView
->
setScene
(
CurScene
);
penColor
.
r
=
penColor
.
g
=
penColor
.
b
=
0
;
...
...
@@ -784,16 +787,22 @@ DrawModule::DrawModule(ExtensionSystem::KPlugin * parent)
CurView
->
setNet
();
netStepX
=
1
;
netStepY
=
1
;
CurView
->
setHorizontalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
CurView
->
setVerticalScrollBarPolicy
(
Qt
::
ScrollBarAlwaysOff
);
QBrush
curBackground
=
QBrush
(
QColor
(
DrawSettings
()
->
value
(
"Draw/BackColor"
,
"lightgreen"
).
toString
()));
CurScene
->
setBackgroundBrush
(
curBackground
);
}
QString
DrawModule
::
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
)
{
if
(
!
configurationParameters
.
contains
(
"tablesOnly"
))
{
createGui
();
}
return
""
;
}
void
DrawModule
::
openFile
()
...
...
src/actors/draw/drawmodule.h
View file @
3d2dd5b2
...
...
@@ -205,6 +205,7 @@ public /* methods */:
{
return
QColor
(
DrawSettings
()
->
value
(
"AxisColor"
,
"blue"
).
toString
());
}
QString
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
runtimeParameters
);
public
slots
:
void
changeGlobalState
(
ExtensionSystem
::
GlobalState
old
,
ExtensionSystem
::
GlobalState
current
);
void
loadActorData
(
QIODevice
*
source
);
...
...
@@ -233,6 +234,7 @@ public slots:
/* ========= CLASS PRIVATE ========= */
private:
void
createGui
();
void
CreatePen
(
void
);
DrawScene
*
CurScene
;
...
...
src/actors/grasshopper/grasshoppermodule.cpp
View file @
3d2dd5b2
...
...
@@ -33,14 +33,29 @@ private:
GrasshopperModule
::
GrasshopperModule
(
ExtensionSystem
::
KPlugin
*
parent
)
:
GrasshopperModuleBase
(
parent
)
{
kuznec
=
new
KumKuznec
(
myResourcesDir
());
connect
(
m_actionGrasshopperNewEnvironment
,
SIGNAL
(
triggered
())
,
kuznec
,
SLOT
(
ClearPicture
()));
connect
(
m_actionGrasshopperLoadEnvironment
,
SIGNAL
(
triggered
())
,
kuznec
,
SLOT
(
LoadFromFileActivated
()));
connect
(
m_actionGrasshopperSave
,
SIGNAL
(
triggered
())
,
kuznec
,
SLOT
(
SaveToFileActivated
()));
// Module constructor, called once on plugin load
// TODO implement me
}
void
GrasshopperModule
::
createGui
()
{
kuznec
=
new
KumKuznec
(
myResourcesDir
());
}
QString
GrasshopperModule
::
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
)
{
if
(
!
configurationParameters
.
contains
(
"tablesOnly"
))
{
createGui
();
}
return
""
;
}
/* public static */
QList
<
ExtensionSystem
::
CommandLineParameter
>
GrasshopperModule
::
acceptableCommandLineParameters
()
{
// See "src/shared/extensionsystem/commandlineparameter.h" for constructor details
...
...
@@ -77,6 +92,7 @@ GrasshopperModule::GrasshopperModule(ExtensionSystem::KPlugin * parent)
/* public */
QWidget
*
GrasshopperModule
::
mainWidget
()
const
{
if
(
!
kuznec
)
return
0
;
// Returns module main view widget, or nullptr if there is no any views
// NOTE: the method is const and might be called at any time,
// so DO NOT create widget here, just return!
...
...
@@ -86,6 +102,7 @@ GrasshopperModule::GrasshopperModule(ExtensionSystem::KPlugin * parent)
/* public */
QWidget
*
GrasshopperModule
::
pultWidget
()
const
{
if
(
!
kuznec
)
return
0
;
// Returns module control view widget, or nullptr if there is no control view
// NOTE: the method is const and might be called at any time,
// so DO NOT create widget here, just return!
...
...
src/actors/grasshopper/grasshoppermodule.h
View file @
3d2dd5b2
...
...
@@ -32,6 +32,7 @@ public /* methods */:
static
QList
<
ExtensionSystem
::
CommandLineParameter
>
acceptableCommandLineParameters
();
QWidget
*
mainWidget
()
const
;
QWidget
*
pultWidget
()
const
;
QString
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
runtimeParameters
);
public
slots
:
void
changeGlobalState
(
ExtensionSystem
::
GlobalState
old
,
ExtensionSystem
::
GlobalState
current
);
void
loadActorData
(
QIODevice
*
source
);
...
...
@@ -48,6 +49,7 @@ public slots:
private:
void
createGui
();
KumKuznec
*
kuznec
;
...
...
src/actors/isometricrobot/isometricrobotmodule.cpp
View file @
3d2dd5b2
...
...
@@ -17,15 +17,30 @@ namespace ActorIsometricRobot {
IsometricRobotModule
::
IsometricRobotModule
(
ExtensionSystem
::
KPlugin
*
parent
)
:
IsometricRobotModuleBase
(
parent
)
,
window_
(
new
Robot25DWindow
(
parent
->
myResourcesDir
(),
0
))
,
robotView_
(
window_
->
robotView
())
,
window_
(
0
)
,
robotView_
(
0
)
,
parentObject_
(
parent
)
{
}
void
IsometricRobotModule
::
createGui
()
{
window_
=
new
Robot25DWindow
(
parentObject_
->
myResourcesDir
(),
0
);
robotView_
=
window_
->
robotView
();
connect
(
m_actionRobot25DLoadEnvironment
,
SIGNAL
(
triggered
()),
window_
,
SLOT
(
handleLoadAction
()));
connect
(
m_actionRobot25DResetEnvironment
,
SIGNAL
(
triggered
()),
this
,
SLOT
(
reset
()));
}
QString
IsometricRobotModule
::
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
)
{
if
(
!
configurationParameters
.
contains
(
"tablesOnly"
))
{
createGui
();
}
return
""
;
}
QList
<
ExtensionSystem
::
CommandLineParameter
>
IsometricRobotModule
::
acceptableCommandLineParameters
()
{
return
QList
<
ExtensionSystem
::
CommandLineParameter
>
();
...
...
src/actors/isometricrobot/isometricrobotmodule.h
View file @
3d2dd5b2
...
...
@@ -56,10 +56,13 @@ public:
// GUI access methods
QWidget
*
mainWidget
()
const
;
inline
QWidget
*
pultWidget
()
const
{
return
nullptr
;
}
QString
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
runtimeParameters
);
private:
void
createGui
();
Robot25DWindow
*
window_
;
Robot25D
::
RobotView
*
robotView_
;
ExtensionSystem
::
KPlugin
*
parentObject_
;
};
// IsometricRobotModule
...
...
src/actors/painter/paintermodule.cpp
View file @
3d2dd5b2
...
...
@@ -21,6 +21,12 @@ namespace ActorPainter {
PainterModule
::
PainterModule
(
ExtensionSystem
::
KPlugin
*
parent
)
:
PainterModuleBase
(
parent
)
{
m_window
=
0
;
dirty_
=
true
;
}
void
PainterModule
::
createGui
()
{
m_window
=
new
PainterWindow
(
this
,
0
);
view
=
m_window
->
view
();
...
...
@@ -31,11 +37,18 @@ PainterModule::PainterModule(ExtensionSystem::KPlugin * parent)
canvasLock
=
new
QMutex
;
m_window
->
setCanvasSize
(
canvas
->
size
());
dirtyLock_
=
new
QMutex
;
dirty_
=
true
;
startTimer
(
50
);
reset
();
}
QString
PainterModule
::
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
)
{
if
(
!
configurationParameters
.
contains
(
"tablesOnly"
))
{
createGui
();
}
return
""
;
}
void
PainterModule
::
timerEvent
(
QTimerEvent
*
event
)
{
dirtyLock_
->
lock
();
...
...
src/actors/painter/paintermodule.h
View file @
3d2dd5b2
...
...
@@ -83,8 +83,10 @@ public:
// GUI access methods
QWidget
*
mainWidget
()
const
;
inline
QWidget
*
pultWidget
()
const
{
return
nullptr
;
}
QString
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
runtimeParameters
);
private:
private:
void
createGui
();
void
timerEvent
(
QTimerEvent
*
);
void
markViewDirty
();
void
drawPolygon
(
const
QVector
<
QPoint
>
&
points
);
...
...
src/actors/robot/robotmodule.cpp
View file @
3d2dd5b2
...
...
@@ -3302,10 +3302,17 @@ RobotModule::RobotModule(ExtensionSystem::KPlugin * parent)
*/
animation
=
true
;
pressed
=
false
;
m_mainWidget
=
0
;
m_pultWidget
=
0
;
}
void
RobotModule
::
createGui
()
{
field
=
new
RoboField
(
0
);
//field->editField();
field
->
createField
(
10
,
15
);
field
->
setRoboPos
(
0
,
0
);
field
->
createRobot
();
view
=
new
RobotView
(
field
);
...
...
@@ -3342,7 +3349,7 @@ RobotModule::RobotModule(ExtensionSystem::KPlugin * parent)
connect
(
m_actionRobotLoadEnvironment
,
SIGNAL
(
triggered
())
,
this
,
SLOT
(
loadEnv
()));
connect
(
m_actionRobotRevertEnvironment
,
SIGNAL
(
triggered
())
,
this
,
SLOT
(
resetEnv
()));
connect
(
m_actionRobotSaveEnvironment
,
SIGNAL
(
triggered
())
,
this
,
SLOT
(
saveEnv
()));
connect
(
m_actionRobotEditEnvironment
,
SIGNAL
(
triggered
())
,
this
,
SLOT
(
editEnv
()));
connect
(
m_actionRobotEditEnvironment
,
SIGNAL
(
triggered
())
,
this
,
SLOT
(
editEnv
()));
connect
(
m_actionRobotNewEnvironment
,
SIGNAL
(
triggered
())
,
this
,
SLOT
(
newEnv
()));
connect
(
m_actionRobotAutoWindowSize
,
SIGNAL
(
triggered
())
,
this
,
SLOT
(
setWindowSize
()));
...
...
@@ -3350,8 +3357,9 @@ RobotModule::RobotModule(ExtensionSystem::KPlugin * parent)
rescentMenu
=
new
QMenu
();
m_actionRobotLoadRescent
->
setMenu
(
rescentMenu
);
view
->
setWindowTitle
(
trUtf8
(
"Робот - нет файла"
));
}
}
void
RobotModule
::
copyFromPult
(
QString
log
)
{
QClipboard
*
clipboard
=
QApplication
::
clipboard
();
...
...
@@ -3492,13 +3500,16 @@ QList<ExtensionSystem::CommandLineParameter> RobotModule::acceptableCommandLine
}
QString
RobotModule
::
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
runtimeParameters
)
{
ExtensionSystem
::
SettingsPtr
sett
;
sett
=
robotSettings
();
{
if
(
!
configurationParameters
.
contains
(
"tablesOnly"
))
{
createGui
();
ExtensionSystem
::
SettingsPtr
sett
;
sett
=
robotSettings
();
if
(
runtimeParameters
.
value
(
"field"
).
isValid
())
{
qDebug
()
<<
"FIELD:|"
<<
runtimeParameters
.
value
(
"field"
).
toString
()
<<
"|"
;
// std::cout <<"FIELD:" <<runtimeParameters.value("field").toString().toStdString();
// std::cout <<"FIELD:" <<runtimeParameters.value("field").toString().toStdString();
if
(
LoadFromFile
(
runtimeParameters
.
value
(
"field"
).
toString
())
!=
0
)
return
"Error loading:"
+
runtimeParameters
.
value
(
"field"
).
toString
();
return
""
;
}
...
...
@@ -3506,17 +3517,19 @@ QString RobotModule::initialize(const QStringList &configurationParameters, cons
{
if
(
LoadFromFile
(
sett
->
value
(
"Robot/SFF"
).
toString
())
!=
0
){
createEmptyField
(
7
,
7
);
}
}
setWindowSize
();
}
if
(
sett
->
value
(
"Robot/Dir"
).
isValid
())
{
curDir
=
sett
->
value
(
"Robot/Dir"
).
toString
();
}
// setWindowSize();
return
""
;
// setWindowSize();
}
return
""
;
}
void
RobotModule
::
runGoUp
()
{
/* TODO implement me */
...
...
src/actors/robot/robotmodule.h
View file @
3d2dd5b2
...
...
@@ -525,6 +525,7 @@ namespace ActorRobot {
void
copyFromPult
(
QString
log
);
private:
void
createGui
();
void
createEmptyField
(
int
rows
,
int
cols
);
int
LoadFromFile
(
QString
p_FileName
);
int
SaveToFile
(
QString
p_FileName
);
...
...
src/actors/turtle/turtlemodule.cpp
View file @
3d2dd5b2
...
...
@@ -30,14 +30,25 @@ namespace ActorTurtle {
};
TurtleModule
::
TurtleModule
(
ExtensionSystem
::
KPlugin
*
parent
)
:
TurtleModuleBase
(
parent
)
{
Turtle
=
0
;
Tpult
=
0
;
animation
=
false
;
}
void
TurtleModule
::
createGui
()
{
Turtle
=
new
turtle
(
myResourcesDir
());
Tpult
=
new
TurtlePult
(
myResourcesDir
());
Tpult
->
turtleObj
=
Turtle
;
animation
=
false
;
// Module constructor, called once on plugin load
// TODO implement me
}
QString
TurtleModule
::
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
)
{
if
(
!
configurationParameters
.
contains
(
"tablesOnly"
))
{
createGui
();
}
return
""
;
}
/* public static */
QList
<
ExtensionSystem
::
CommandLineParameter
>
TurtleModule
::
acceptableCommandLineParameters
()
...
...
@@ -85,7 +96,7 @@ TurtleModule::TurtleModule(ExtensionSystem::KPlugin * parent)
// Returns module control view widget, or nullptr if there is no control view
// NOTE: the method is const and might be called at any time,
// so DO NOT create widget here, just return!
if
(
!
Tpult
)
return
0
;
// TODO implement me
static
QWidget
*
dummy
=
new
AAA
(
Tpult
);
return
dummy
;
...
...
src/actors/turtle/turtlemodule.h
View file @
3d2dd5b2
...
...
@@ -32,6 +32,7 @@ public /* methods */:
static
QList
<
ExtensionSystem
::
CommandLineParameter
>
acceptableCommandLineParameters
();
QWidget
*
mainWidget
()
const
;
QWidget
*
pultWidget
()
const
;
QString
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
runtimeParameters
);
public
slots
:
void
changeGlobalState
(
ExtensionSystem
::
GlobalState
old
,
ExtensionSystem
::
GlobalState
current
);
void
loadActorData
(
QIODevice
*
source
);
...
...
@@ -50,6 +51,7 @@ public slots:
/* ========= CLASS PRIVATE ========= */
private:
void
createGui
();
turtle
*
Turtle
;
TurtlePult
*
Tpult
;
bool
animation
;
...
...
src/actors/vodoley/vodoleymodule.cpp
View file @
3d2dd5b2
...
...
@@ -25,6 +25,11 @@ VodoleyModule::VodoleyModule(ExtensionSystem::KPlugin * parent)
:
VodoleyModuleBase
(
parent
)
{
self
=
this
;
MainWindow
=
0
;
}
void
VodoleyModule
::
createGui
()
{
MainWindow
=
new
Vodoley
();
// Module constructor, called once on plugin load
// TODO implement me
...
...
@@ -36,6 +41,14 @@ VodoleyModule::VodoleyModule(ExtensionSystem::KPlugin * parent)
// m_actionVodoleyNewEnvironment
}
QString
VodoleyModule
::
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
)
{
if
(
!
configurationParameters
.
contains
(
"tablesOnly"
))
{
createGui
();
}
return
""
;
}
/* public static */
QList
<
ExtensionSystem
::
CommandLineParameter
>
VodoleyModule
::
acceptableCommandLineParameters
()
{
// See "src/shared/extensionsystem/commandlineparameter.h" for constructor details
...
...
src/actors/vodoley/vodoleymodule.h
View file @
3d2dd5b2
...
...
@@ -32,6 +32,7 @@ public /* methods */:
static
QList
<
ExtensionSystem
::
CommandLineParameter
>
acceptableCommandLineParameters
();
QWidget
*
mainWidget
()
const
;
QWidget
*
pultWidget
()
const
;
QString
initialize
(
const
QStringList
&
configurationParameters
,
const
ExtensionSystem
::
CommandLine
&
runtimeParameters
);
public
slots
:
void
changeGlobalState
(
ExtensionSystem
::
GlobalState
old
,
ExtensionSystem
::
GlobalState
current
);
void
loadActorData
(
QIODevice
*
source
);
...
...
@@ -57,6 +58,7 @@ public slots:
/* ========= CLASS PRIVATE ========= */
private:
void
createGui
();
Vodoley
*
MainWindow
;
...
...
src/app/kumir2-bc/CMakeLists.txt
View file @
3d2dd5b2
...
...
@@ -20,7 +20,7 @@ endif()
set
(
CONFIGURATION_TEMPLATE
"Actor*,!KumirCompilerTool,KumirCodeGenerator,KumirAnalizer
\(
teacher,preload=Files,preload=Strings
\)
"
"Actor*
(tablesOnly)
,!KumirCompilerTool,KumirCodeGenerator,KumirAnalizer
\(
teacher,preload=Files,preload=Strings
\)
"
)
set
(
SRC ../main.cpp
)
...
...
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