Commit a7a69679 authored by Denis Khachko's avatar Denis Khachko

no message

parent 8e10396a
......@@ -336,6 +336,7 @@ void TurtlePult::Up()
turtleObj->runForward(stepVal->value ());
Logger->appendText(QString::fromUtf8("вперед(")+QString::number(stepVal->value ())+")\n",QString::fromUtf8("вперед(")+QString::number(stepVal->value ())+")","OK");
turtleObj->getCurView()->forceRedraw();
};
......@@ -346,13 +347,14 @@ void TurtlePult::Down()
turtleObj->runBack(stepVal->value ());
Logger->appendText(QString::fromUtf8("назад(")+QString::number(stepVal->value ())+")\n",QString::fromUtf8("назад(")+QString::number(stepVal->value ())+")","OK");
turtleObj->getCurView()->forceRedraw();
};
void TurtlePult::Left()
{
turtleObj->runLeft(gradVal->value ());
Logger->appendText(QString::fromUtf8("влево(")+QString::number(gradVal->value ())+")\n",QString::fromUtf8("влево(")+QString::number(gradVal->value ())+")","OK");
turtleObj->getCurView()->forceRedraw();
};
void TurtlePult::Right()
......@@ -360,28 +362,33 @@ void TurtlePult::Right()
if(!greenLight->link())return;
turtleObj->runRight(gradVal->value ());
Logger->appendText(QString::fromUtf8("вправо(")+QString::number(gradVal->value ())+")\n",QString::fromUtf8("вправо(")+QString::number(gradVal->value ())+")","OK");
turtleObj->getCurView()->forceRedraw();
};
void TurtlePult::SwStena()
{
if(askFree->isChecked () ) askFree->setChecked(false);
{//
// if(!greenLight->link())return;
// turtleObj->runTailDown();
// if(askFree->isChecked () ) askFree->setChecked(false);
};
void TurtlePult::SwSvobodno()
{
if(askStena->isChecked () )askStena->setChecked(false);
// if(!greenLight->link())return;
// turtleObj->runTailUp();
};
void TurtlePult::TempS()
{
// if(!greenLight->link())return;
// turtleObj->TailDown();
// Logger->appendText(QString::fromUtf8("опустить хвост\n"),QString::fromUtf8("опустить хвост"),"OK");
if(!greenLight->link())return;
turtleObj->runTailDown();
Logger->appendText(QString::fromUtf8("опустить хвост\n"),QString::fromUtf8("опустить хвост"),"OK");
};
void TurtlePult::RadS()
{
// if(!greenLight->link())return;
// turtleObj->TailUp();
// Logger->appendText(QString::fromUtf8("поднять хвост\n"),QString::fromUtf8("поднять хвост"),"OK");
if(!greenLight->link())return;
turtleObj->runTailUp();
Logger->appendText(QString::fromUtf8("поднять хвост\n"),QString::fromUtf8("поднять хвост"),"OK");
};
void TurtlePult::resetTurtle()
......
......@@ -57,23 +57,38 @@
]
},
"settings": {
"BackColor": {
"type": "color",
"default": "#FFFFFF",
"title": {"ascii": "Background color", "ru_RU": "Цвет фона"}
},
"LineColor": {
"type": "color",
"default": "#C8C800",
"title": {"ascii": "Grid color", "ru_RU": "Цвет сетки"}
},
"AxisColor": {
"type": "color",
"default": "#C8C800",
"title": {"ascii": "Axis color", "ru_RU": "Цвет осей"}
}
}
"settings": {
"BackColor": {
"type": "color",
"default": "#99FF99",
"title": {"ascii": "Background color", "ru_RU": "Цвет фона"}
},
"LineColor": {
"type": "color",
"default": "#669966",
"title": {"ascii": "Grid color", "ru_RU": "Цвет сетки"}
},
"AxisColor": {
"type": "color",
"default": "#999900",
"title": {"ascii": "Axis color", "ru_RU": "Цвет осей"}
},
"AxisWidth": {
"type": "int",
"default": "2",
"title": {"ascii": "Axis width", "ru_RU": "Толщина осей"}
},
"NetWidth": {
"type": "int",
"default": "1",
"title": {"ascii": "Net width", "ru_RU": "Толщина сетки"}
},
"LineWidth": {
"type": "int",
"default": "4",
"title": {"ascii": "Line width", "ru_RU": "Толщина линий"}
}
}
}
......@@ -182,6 +182,7 @@ const double Pi = 3.14159265;
QGraphicsLineItem* line=addLine(lineF);
QPen mp=QPen(QColor(color));
mp.setWidthF(width);
mp.setCapStyle(Qt::RoundCap);
mp.setCosmetic(true);
line->setPen(mp);
line->setZValue(90);
......@@ -835,6 +836,14 @@ void TurtleModule::createGui()
connect(showToolsBut,SIGNAL(toggled (bool)),this,SLOT(showNavigator(bool)));
showToolsBut->setIcon(QIcon(myResourcesDir().absoluteFilePath("menu-24x24-black.png")));
showTurtleBut=new QToolButton(CurView);
showTurtleBut->move(50,20);
showTurtleBut->setCheckable(true);
showTurtleBut->setIcon(QIcon(myResourcesDir().absoluteFilePath("Trtl1.svg")));
showTurtleBut->setChecked(true);
connect(showTurtleBut,SIGNAL(toggled (bool)),this,SLOT(showTurtleSlt(bool)));
// connect(m_actionDrawSaveDrawing,SIGNAL(triggered()),this,SLOT(saveFile()));
// connect(m_actionDrawLoadDrawing,SIGNAL(triggered()),this,SLOT(openFile()));
connect(navigator,SIGNAL(redrawNet()),this,SLOT(drawNet()));
......@@ -872,7 +881,7 @@ void TurtleModule::createGui()
CurView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
CurView->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
QBrush curBackground=QBrush(QColor(TurtleSettings()->value("Draw/BackColor","#B4B40A").toString()));
QBrush curBackground=QBrush(QColor(TurtleSettings()->value("BackColor","#FFFFCC").toString()));
CurScene->setBackgroundBrush (curBackground);
Color Black;
......@@ -1007,7 +1016,7 @@ QString TurtleModule::initialize(const QStringList &configurationParameters, con
{
mutex.lock();
mPen->tailDown();
mPen->tailUp();
mutex.unlock();
}
......@@ -1038,7 +1047,7 @@ mutex.unlock();
if(!mPen->isTailUp()) CurScene->addDrawLine(QLineF(QPointF(oldX,oldY),mPen->pos()), QColor(penColor.r, penColor.g, penColor.b, penColor.a),mySettings()->value("LineWidth",4).toFloat());
mutex.unlock();
CurScene->update();
}
/* public slot */ void TurtleModule::runBack(const qreal dist)
......@@ -1060,6 +1069,7 @@ mutex.unlock();
if(!mPen->isTailUp()) CurScene->addDrawLine(QLineF(QPointF(oldX,oldY),mPen->pos()), QColor(penColor.r, penColor.g, penColor.b, penColor.a),mySettings()->value("LineWidth",4).toFloat());
mutex.unlock();
CurScene->update();
}
......@@ -1089,6 +1099,7 @@ mutex.unlock();
// Turtle->rotate();
mutex.unlock();
CurScene->update();
}
/* public slot */ void TurtleModule::runSetPenColor(const Color& color)
......@@ -1132,6 +1143,15 @@ mutex.unlock();
{
navigator->setVisible(state);
};
void TurtleModule::showTurtleSlt(bool state)
{
mPen->setTurtleVis(state);
CurView->update();
}
void TurtleModule::netStepChange(double value)
{
double oldValue=NetStepY();
......
......@@ -71,6 +71,10 @@ namespace ActorTurtle {
{
return tailup;
}
void setTurtleVis(bool vis)
{
turtle->setVisible(vis);
}
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
{
Q_UNUSED(option) Q_UNUSED(widget);
......@@ -79,7 +83,7 @@ namespace ActorTurtle {
painter->setBrush(tailColor);
painter->drawPath(tail);
}
turtle->renderer()->render(painter,QRectF(-15,-30,30,30));
if(turtle->isVisible())turtle->renderer()->render(painter,QRectF(-15,-30,30,30));
}
......@@ -236,7 +240,7 @@ public /* methods */:
static ExtensionSystem::SettingsPtr TurtleSettings();
QColor axisColor()
{
return QColor(TurtleSettings()->value("AxisColor","blue").toString());
return QColor(TurtleSettings()->value("AxisColor","#996600").toString());
}
TurtleView * getCurView()
{
......@@ -267,6 +271,7 @@ public /* methods */:
void showNavigator(bool state);
void showTurtleSlt(bool state);
/* ========= CLASS PRIVATE ========= */
private:
......@@ -289,7 +294,7 @@ private:
Color penColor;
DrawNavigator* navigator;
QToolButton *showToolsBut;
QToolButton *showToolsBut,*showTurtleBut;
QDir curDir;
bool animate;
qreal curAngle;
......
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