Commit e71e5899 authored by Denis Khachko's avatar Denis Khachko

Robot pult: fix Cell tab.

parent 9824cdfe
......@@ -19,6 +19,10 @@ Rectangle {
signal checkFreeRight
signal checkFreeTop
signal checkFreeBottom
signal checkRadiation
signal checkTemp
signal checkColored
signal checkClear
signal copyTextToKumir(string hjghjgjh)
property bool buttonsLocked: false
......@@ -372,6 +376,14 @@ Rectangle {
id: image6
source: "btn_temperature.png"
opacity: 0
}
onClicked: {
if (buttonsLocked)
return;
buttonsLocked = true;
commandLog.text += "температура\n";
scroll.updateScroll();
parent.checkTemp();
}
}
......@@ -389,6 +401,14 @@ Rectangle {
source: "btn_radiation.png"
opacity: 0
}
onClicked: {
if (buttonsLocked)
return;
buttonsLocked = true;
commandLog.text += "радиация\n";
scroll.updateScroll();
parent.checkRadiation();
}
}
Button {
......@@ -404,6 +424,14 @@ Rectangle {
y: 6
source: "btn_painted.png"
opacity: 0
}
onClicked: {
if (buttonsLocked)
return;
buttonsLocked = true;
commandLog.text += "закрашена\n";
scroll.updateScroll();
parent.checkColored();
}
}
......@@ -421,6 +449,14 @@ Rectangle {
source: "btn_clean.png"
opacity: 0
}
onClicked: {
if (buttonsLocked)
return;
buttonsLocked = true;
commandLog.text += "клетка чистая\n";
scroll.updateScroll();
parent.checkClear();
}
}
Button {
......
......@@ -3327,6 +3327,10 @@ RobotModule::RobotModule(ExtensionSystem::KPlugin * parent)
connect(pult, SIGNAL(checkFreeRight()), this, SLOT(runIsFreeAtRight()));
connect(pult, SIGNAL(checkFreeTop()), this, SLOT(runIsFreeAtTop()));
connect(pult, SIGNAL(checkFreeBottom()), this, SLOT(runIsFreeAtBottom()));
connect(pult, SIGNAL(checkRadiation()), this, SLOT(runRadiation()));
connect(pult, SIGNAL(checkTemp()), this, SLOT(runTemperature()));
connect(pult, SIGNAL(checkColored()), this, SLOT(runIsColor()));
connect(pult, SIGNAL(checkClear()), this, SLOT(runIsClear()));
connect(pult, SIGNAL(copyTextToKumir(QString)), this, SLOT(copyFromPult(QString)));
connect(this, SIGNAL(sendToPultLog(QVariant)), pult, SLOT(addToResultLog(QVariant)));
startField=field->Clone();
......@@ -3712,7 +3716,7 @@ bool RobotModule::runIsColor()
};
double RobotModule::runRadiation(){
double result = field->currentCell()->radiation;
QString status = result? trUtf8("да") : trUtf8("нет");
QString status = QString::number(result);
if (sender() && qobject_cast<QDeclarativeItem*>(sender())) {
emit sendToPultLog(status);
}
......@@ -3720,7 +3724,7 @@ bool RobotModule::runIsColor()
};
int RobotModule::runTemperature(){
int result = field->currentCell()->temperature;
QString status = result? trUtf8("да") : trUtf8("нет");
QString status = QString::number(result);
if (sender() && qobject_cast<QDeclarativeItem*>(sender())) {
emit sendToPultLog(status);
}
......
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