Commit 7e55e878 authored by Denis Khachko's avatar Denis Khachko

Vodoley module n course manager Web debug.

parent c746d583
......@@ -3,3 +3,4 @@ add_subdirectory(robot)
add_subdirectory(complexnumbers)
add_subdirectory(robot25d)
add_subdirectory(draw)
add_subdirectory(vodoley)
......@@ -79,7 +79,8 @@ DrawModule::DrawModule(ExtensionSystem::KPlugin * parent)
/* public slot */ void DrawModule::reloadSettings(ExtensionSystem::SettingsPtr settings, const QStringList & keys)
{
// Updates setting on module load, workspace change or appliyng settings dialog
// Updates setting on module load, workspace change or appliyng settings dialog.
// If @param keys is empty -- should reload all settings, otherwise load only setting specified by @param keys
// TODO implement me
Q_UNUSED(settings); // Remove this line on implementation
Q_UNUSED(keys); // Remove this line on implementation
......
......@@ -34,7 +34,7 @@ public /* methods */:
public slots:
void changeGlobalState(ExtensionSystem::GlobalState old, ExtensionSystem::GlobalState current);
void loadActorData(QIODevice * source);
void reloadSettings(ExtensionSystem::SettingsPtr settings, const QStringList &);
void reloadSettings(ExtensionSystem::SettingsPtr settings, const QStringList & keys);
void reset();
void setAnimationEnabled(bool enabled);
void runSetupPen();
......
set(QT_USE_QTMAIN 1)
find_package(Qt4 4.7.0 COMPONENTS QtCore QtGui REQUIRED)
find_package(PythonInterp 2.6 REQUIRED)
include (${QT_USE_FILE})
include(../../kumir2_plugin.cmake)
set(SOURCES
vodoleymodule.cpp
)
set(MOC_HEADERS
vodoleymodule.h
)
add_custom_command(
OUTPUT
${CMAKE_CURRENT_BINARY_DIR}/vodoleymodulebase.cpp
${CMAKE_CURRENT_BINARY_DIR}/vodoleymodulebase.h
${CMAKE_CURRENT_BINARY_DIR}/vodoleyplugin.cpp
${CMAKE_CURRENT_BINARY_DIR}/vodoleyplugin.h
${CMAKE_CURRENT_BINARY_DIR}/ActorVodoley.pluginspec
COMMAND ${PYTHON_EXECUTABLE}
${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/gen_actor_source.py
--update
${CMAKE_CURRENT_SOURCE_DIR}/vodoley.json
DEPENDS
${CMAKE_CURRENT_SOURCE_DIR}/vodoley.json
${CMAKE_CURRENT_SOURCE_DIR}/../../../scripts/gen_actor_source.py
)
add_custom_target(
ActorVodoleyPluginSpec
ALL
${CMAKE_COMMAND} -E copy
${CMAKE_CURRENT_BINARY_DIR}/ActorVodoley.pluginspec ${PLUGIN_OUTPUT_PATH}
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/ActorVodoley.pluginspec
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vodoleymodulebase.moc.cpp
COMMAND ${QT_MOC_EXECUTABLE}
-I${CMAKE_SOURCE_DIR}/src/shared
-o${CMAKE_CURRENT_BINARY_DIR}/vodoleymodulebase.moc.cpp
${CMAKE_CURRENT_BINARY_DIR}/vodoleymodulebase.h
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vodoleymodulebase.h
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/vodoleyplugin.moc.cpp
COMMAND ${QT_MOC_EXECUTABLE}
-I${CMAKE_SOURCE_DIR}/src/shared
-o${CMAKE_CURRENT_BINARY_DIR}/vodoleyplugin.moc.cpp
${CMAKE_CURRENT_BINARY_DIR}/vodoleyplugin.h
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/vodoleyplugin.h
)
set(SOURCES_GENERATED
vodoleymodulebase.cpp
vodoleyplugin.cpp
)
set(MOC_SOURCES_GENERATED
vodoleymodulebase.moc.cpp
vodoleyplugin.moc.cpp
)
qt4_wrap_cpp(MOC_SOURCES ${MOC_HEADERS})
install(
FILES ${PLUGIN_OUTPUT_PATH}/ActorVodoley.pluginspec
DESTINATION ${PLUGINS_DIR}
)
handleTranslation(ActorVodoley)
add_library(
ActorVodoley
SHARED
${MOC_SOURCES} ${SOURCES}
${MOC_SOURCES_GENERATED} ${SOURCES_GENERATED}
)
target_link_libraries(
ActorVodoley
${QT_LIBRARIES}
ExtensionSystem
Widgets
)
copyResources(actors/vodoley)
install(
TARGETS ActorVodoley
DESTINATION ${PLUGINS_DIR}
)
{
"name": { "ascii": "vodoley", "ru_RU": "Водолей" },
"methods": [
{ "name": {"ascii": "fill A", "ru_RU": "наполни A" }},
{ "name": {"ascii": "fill B", "ru_RU": "наполни B" } },
{ "name": {"ascii": "fill C", "ru_RU": "наполни C" } },
{ "name": {"ascii": "empty A", "ru_RU": "вылей A" } },
{ "name": {"ascii": "empty B", "ru_RU": "вылей B" } },
{ "name": {"ascii": "empty C", "ru_RU": "вылей C" } },
{ "name": {"ascii": "from A to B", "ru_RU": "перелей из A в B" } },
{ "name": {"ascii": "from A to C", "ru_RU": "перелей из A в C" } },
{ "name": {"ascii": "from B to A", "ru_RU": "перелей из B в A" } },
{ "name": {"ascii": "from B to C", "ru_RU": "перелей из B в C" } },
{ "name": {"ascii": "from C to B", "ru_RU": "перелей из C в B" } },
{ "name": {"ascii": "from C to A", "ru_RU": "перелей из C в A" } },
{
"name": {"ascii": "task complited", "ru_RU": "@@задание выполненно"},
"async": false,
"returnType": "bool"
}
],
"gui": {
"windows": [
{ "role": "main", "icon": "vodoley" },
{ "role": "pult", "icon": "vodo-pult" }
],
"menus": [
{
"title": { "ascii": "Vodoley", "ru_RU": "Водолей" },
"items": [
{
"title": {
"ascii": "Load Environment...",
"ru_RU": "Загрузить обстановку..."
},
"icon": "file-open"
},
{
"title": {
"ascii": "Load Rescent...",
"ru_RU": "Недавние обстановки"
},
"icon": "file-rescent"
},
{
"title": {
"ascii": "Revert Environment",
"ru_RU": "Вернуть исходную обстановку"
},
"icon": "file-revert"
},
{
"title": {
"ascii": "Save Environment...",
"ru_RU": "Сохранить обстановку..."
},
"icon": "file-save-as"
},
{
"title": {
"ascii": "Edit Environment...",
"ru_RU": "Редактировать обстановку..."
},
"icon": "file-save-as"
},
{
"title": {
"ascii": "Auto window size.",
"ru_RU": "Авто размер окна"
},
"icon": "file-save-as"
},
{
"title": {
"ascii": "New Environment...",
"ru_RU": "Новая обстановка..."
},
"icon": "file-new"
}
]
}
]
},
"settings": {
"TextColor": {
"type": "color",
"default": "#FFFFFF",
"title": {"ascii": "Text color", "ru_RU": "Цвет смиволов"}
},
"LineColor": {
"type": "color",
"default": "#C8C800",
"title": {"ascii": "Grid color", "ru_RU": "Цвет сетки"}
},
"LineColorEdit": {
"type": "color",
"default": "#C8C800",
"title": {"ascii": "Grid color (edit mode)", "ru_RU": "Цвет сетки (редактирование)"}
},
"WallColor": {
"type": "color",
"default": "#C8C800",
"title": {"ascii": "Wall color", "ru_RU": "Цвет стен"}
},
"NormalColor": {
"type": "color",
"default": "#289628",
"title": {"ascii": "Background color", "ru_RU": "Цвет поля"}
},
"EditColor": {
"type": "color",
"default": "#00008C",
"title": {"ascii": "Background color (edit mode)", "ru_RU": "Цвет поля (редактирование)"}
},
"CellSize": {
"type": "int",
"default": 20,
"minimum": 10,
"maximum": 40,
"title": {"ascii": "Cell size", "ru_RU": "Размер клетки"}
}
}
}
/*
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.
You should change it corresponding to functionality.
*/
// Self include
#include "vodoleymodule.h"
// Kumir includes
#include "extensionsystem/kplugin.h"
// Qt includes
#include <QtCore>
#include <QtGui>
namespace ActorVodoley {
VodoleyModule::VodoleyModule(ExtensionSystem::KPlugin * parent)
: VodoleyModuleBase(parent)
{
// Module constructor, called once on plugin load
// TODO implement me
}
/* public static */ QList<ExtensionSystem::CommandLineParameter> VodoleyModule::acceptableCommandLineParameters()
{
// See "src/shared/extensionsystem/commandlineparameter.h" for constructor details
return QList<ExtensionSystem::CommandLineParameter>();
}
/* public slot */ void VodoleyModule::changeGlobalState(ExtensionSystem::GlobalState old, ExtensionSystem::GlobalState current)
{
// Called when changed kumir state. The states are defined as enum ExtensionSystem::GlobalState:
/*
namespace ExtensionSystem {
enum GlobalState {
GS_Unlocked, // Edit mode
GS_Observe, // Observe mode
GS_Running, // Running mode
GS_Input, // User input required
GS_Pause // Running paused
};
}
*/
// TODO implement me
using namespace ExtensionSystem; // not to write "ExtensionSystem::" each time in this method scope
Q_UNUSED(old); // Remove this line on implementation
Q_UNUSED(current); // Remove this line on implementation
}
/* public slot */ void VodoleyModule::loadActorData(QIODevice * source)
{
// Set actor specific data (like environment)
// The source should be ready-to-read QIODevice like QBuffer or QFile
Q_UNUSED(source); // By default do nothing
}
/* public */ QWidget* VodoleyModule::mainWidget() const
{
// 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!
// TODO implement me
return nullptr;
}
/* public */ QWidget* VodoleyModule::pultWidget() const
{
// 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!
// TODO implement me
return nullptr;
}
/* public slot */ void VodoleyModule::reloadSettings(ExtensionSystem::SettingsPtr settings, const QStringList & keys)
{
// Updates setting on module load, workspace change or appliyng settings dialog.
// If @param keys is empty -- should reload all settings, otherwise load only setting specified by @param keys
// TODO implement me
Q_UNUSED(settings); // Remove this line on implementation
Q_UNUSED(keys); // Remove this line on implementation
}
/* public slot */ void VodoleyModule::reset()
{
// Resets module to initial state before program execution
// TODO implement me
}
/* public slot */ void VodoleyModule::setAnimationEnabled(bool enabled)
{
// Sets GUI animation flag on run
// NOTE this method just setups a flag and might be called anytime, even module not needed
// TODO implement me
Q_UNUSED(enabled); // Remove this line on implementation
}
/* public slot */ void VodoleyModule::runFillA()
{
/* алг наполни A */
// TODO implement me
}
/* public slot */ void VodoleyModule::runFillB()
{
/* алг наполни B */
// TODO implement me
}
/* public slot */ void VodoleyModule::runFillC()
{
/* алг наполни C */
// TODO implement me
}
/* public slot */ void VodoleyModule::runEmptyA()
{
/* алг вылей A */
// TODO implement me
}
/* public slot */ void VodoleyModule::runEmptyB()
{
/* алг вылей B */
// TODO implement me
}
/* public slot */ void VodoleyModule::runEmptyC()
{
/* алг вылей C */
// TODO implement me
}
/* public slot */ void VodoleyModule::runFromAToB()
{
/* алг перелей из A в B */
// TODO implement me
}
/* public slot */ void VodoleyModule::runFromAToC()
{
/* алг перелей из A в C */
// TODO implement me
}
/* public slot */ void VodoleyModule::runFromBToA()
{
/* алг перелей из B в A */
// TODO implement me
}
/* public slot */ void VodoleyModule::runFromBToC()
{
/* алг перелей из B в C */
// TODO implement me
}
/* public slot */ void VodoleyModule::runFromCToB()
{
/* алг перелей из C в B */
// TODO implement me
}
/* public slot */ void VodoleyModule::runFromCToA()
{
/* алг перелей из C в A */
// TODO implement me
}
/* public slot */ bool VodoleyModule::runTaskComplited()
{
/* алг лог @@задание выполненно */
// TODO implement me
return false;
}
} // namespace ActorVodoley
/*
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.
You should change it corresponding to functionality.
*/
#ifndef VODOLEYMODULE_H
#define VODOLEYMODULE_H
// Base class include
#include "vodoleymodulebase.h"
// Kumir includes
#include "extensionsystem/kplugin.h"
// Qt includes
#include <QtCore>
#include <QtGui>
namespace ActorVodoley {
class VodoleyModule
: public VodoleyModuleBase
{
Q_OBJECT
public /* methods */:
VodoleyModule(ExtensionSystem::KPlugin * parent);
static QList<ExtensionSystem::CommandLineParameter> acceptableCommandLineParameters();
QWidget* mainWidget() const;
QWidget* pultWidget() const;
public slots:
void changeGlobalState(ExtensionSystem::GlobalState old, ExtensionSystem::GlobalState current);
void loadActorData(QIODevice * source);
void reloadSettings(ExtensionSystem::SettingsPtr settings, const QStringList & keys);
void reset();
void setAnimationEnabled(bool enabled);
void runFillA();
void runFillB();
void runFillC();
void runEmptyA();
void runEmptyB();
void runEmptyC();
void runFromAToB();
void runFromAToC();
void runFromBToA();
void runFromBToC();
void runFromCToB();
void runFromCToA();
bool runTaskComplited();
/* ========= CLASS PRIVATE ========= */
};
} // namespace ActorVodoley
#endif // VODOLEYMODULE_H
......@@ -69,6 +69,9 @@ isTeacher=false;
setWindowIcon(QIcon(qApp->property("sharePath").toString()+
"/coursemanager/10.png")
);
#ifdef QT_DEBUG
ui->webView->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
#endif
//ui->textBrowser->setVisible(false);
};
QList<QAction*> MainWindowTask::getActions()
......
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE book
PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
"docbookV4.5/docbookx.dtd"
[]
>
<article>
<title>Водолей</title>
<!--
Write module documentation here.
See DocBook specification for more details,
or use some GUI tool to edit this file (like "Serna Free").
-->
</article>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment