|
From: <dhu...@us...> - 2007-01-08 17:11:58
|
Revision: 128
http://svn.sourceforge.net/qcell/?rev=128&view=rev
Author: dhubleizh
Date: 2007-01-08 09:11:50 -0800 (Mon, 08 Jan 2007)
Log Message:
-----------
- typo in KIParserPlugin.cpp
- removed pending /// @todo's from the file
- full intialization of data in on_World_activated()
- proper experiment forward an backward handling
- proper experiment restart handled
Modified Paths:
--------------
trunk/qcell/parsers/KI/KIParserPlugin.h
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/parsers/KI/KIParserPlugin.h
===================================================================
--- trunk/qcell/parsers/KI/KIParserPlugin.h 2007-01-08 16:24:46 UTC (rev 127)
+++ trunk/qcell/parsers/KI/KIParserPlugin.h 2007-01-08 17:11:50 UTC (rev 128)
@@ -22,7 +22,7 @@
public:
KIParserPlugin();
- QByteArray parseOut(QString content, const QString type, const QString subtype="");
+ QByteArray parseOut(QString content, const QString type, const QString subtype="");
};
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-08 16:24:46 UTC (rev 127)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-08 17:11:50 UTC (rev 128)
@@ -12,7 +12,7 @@
{
// GUI setup - earlies possible to show the user, that we're in buisness
setupUi(this);
- sw = new simulationWindow(this);
+ sw = new simulationWindow(this);
QLayoutItem* tmp = centralWidget()->layout()->takeAt(0);
centralWidget()->layout()->addWidget(sw);
centralWidget()->layout()->addItem(tmp);
@@ -65,6 +65,7 @@
}
}
+ /// @todo This function doesn't belong here. It initializes things not fore GUI
setupEngine();
}
@@ -276,8 +277,14 @@
}
/// @todo Fix that!
- CalculationData* cd = (CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt();
- *sw->getStorage() = *cd;
+ data.clear();
+ data.append((CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt());
+ *sw->getStorage() = *data.last();
+ QVector<int> end_coord;
+ end_coord << data.last()->getSizeX()
+ << data.last()->getSizeY()
+ << data.last()->getSizeZ();
+ calc.setCalculationSpace(*new QVector<int>(3, 0), end_coord);
/// @todo Nasty - get that code out of here !
}
else
@@ -360,18 +367,20 @@
void MainWindow::oneStep(int direction)
{
- /// @todo Write oneStep
switch (direction)
{
case Forward:
{
- if(iteration < (data.count()-1))
+ if(iteration >= data.count())
{
- /// @todo moving through the list
+ CalculationData* cd = new CalculationData();
+ *cd = *data[iteration];
+ calc.setForeignDataPointer((char*)cd->getDataPointer());
+ calc.calculate();
}
else
{
- /// @todo processing
+ /// @todo Is this needed?
}
iteration++;
@@ -380,18 +389,17 @@
}
case Back:
{
- if(iteration == 0)
+ if(iteration <= 0)
{
qDebug(tr("You cannot step back beyond the beginning of the experiment!").toAscii());
return;
}
- /// @todo actuall going back
-
iteration--;
}
}
+ *sw->getStorage() = *data[iteration];
iterationLCD->display(iteration);
}
@@ -437,7 +445,6 @@
void MainWindow::on_action_Back_activated()
{
- /// @todo Handle back movement
oneStep( Back);
}
@@ -473,7 +480,9 @@
iteration = 0;
this->iterationLCD->display(iteration);
-// CalculationData backup = data.first();
+ CalculationData* backup = data.first();
+ data.clear();
+ data.append(backup);
}
void MainWindow::on_action_World_save_activated()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|