new layer change code

This commit is contained in:
Alex
2014-04-12 19:27:03 +02:00
parent f5f49df235
commit ef3186992c
58 changed files with 7251 additions and 6768 deletions

View File

@@ -2,7 +2,7 @@
txThread::txThread()
{
lineCounter = 0;
resetState();
}
txThread::~txThread()
@@ -10,6 +10,12 @@ txThread::~txThread()
}
void txThread::resetState()
{
lineCounter = 0;
ignoreFirstM01 = true;
}
QString removeComments(QString intext)
{
////////////////////////////////////////////////remove comments
@@ -32,7 +38,7 @@ QString removeComments(QString intext)
}
}
}
///////////////////////////////////////////////////
///////////////////////////////////////////////////
return outTmp2;
}
@@ -41,7 +47,7 @@ void txThread::set(QString intextfile,spherebot &uibot)
lineCounter = 0;
textfile.clear();
textfile.append(removeComments(intextfile));
qDebug()<<"The textfile String is: \n\n" + textfile + "\n\nENDE\n\n";
//qDebug()<<"The textfile String is: \n\n" + textfile + "\n\nENDE\n\n";
lineMax = textfile.count("\n");
bot = &uibot;
}
@@ -59,6 +65,17 @@ void txThread::sendNext()
if(lineCounter <= lineMax)
{
tmp = textfile.section("\n",lineCounter,lineCounter);
if(tmp.contains("M01"))
{
if(ignoreFirstM01)
{
ignoreFirstM01 = false;
}
else
{
emit layerTransmitted();
}
}
tmp.append("\n");
bot->send(tmp);
double progress= (double) lineCounter/(double)lineMax;
@@ -68,6 +85,7 @@ void txThread::sendNext()
else
{
emit fileTransmitted();
resetState();
return;
}
if(tmp.contains("G4"))