|
From: <dhu...@us...> - 2007-01-06 18:34:16
|
Revision: 108
http://svn.sourceforge.net/qcell/?rev=108&view=rev
Author: dhubleizh
Date: 2007-01-06 10:34:13 -0800 (Sat, 06 Jan 2007)
Log Message:
-----------
- fixed FileDialog's bug (cancel didn't matter)
- added creation of basic structures after parsing
- Neighbourhood file writing
- handled Neighbourhood save action
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-06 18:31:33 UTC (rev 107)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-06 18:34:13 UTC (rev 108)
@@ -117,12 +117,12 @@
}
fd.setFilters(filters);
- fd.exec();
+ if(fd.exec())
+ { if(!fd.selectedFiles().isEmpty())
+ {
+ callParser(fd.selectedFiles().first(), "Neighbourhood");
- if(!fd.selectedFiles().isEmpty())
- {
- callParser(fd.selectedFiles().first(), "Neighbourhood");
-
+ }
}
}
@@ -160,12 +160,13 @@
}
fd.setFilters(filters);
- fd.exec();
-
- if(!fd.selectedFiles().isEmpty())
+ if(fd.exec())
{
- callParser(fd.selectedFiles().first(), "LocalFunction");
+ if(!fd.selectedFiles().isEmpty())
+ {
+ callParser(fd.selectedFiles().first(), "LocalFunction");
+ }
}
}
@@ -203,13 +204,16 @@
}
fd.setFilters(filters);
- fd.exec();
-
- if(!fd.selectedFiles().isEmpty())
+ if(fd.exec())
{
- callParser(fd.selectedFiles().first(), "World");
+ if(!fd.selectedFiles().isEmpty())
+ {
+ callParser(fd.selectedFiles().first(), "World");
+ }
+
}
+
}
void MainWindow::callParser(QString filename, QString type)
@@ -239,7 +243,8 @@
return;
}
- neighbourhood_parsers[subtype]->parse(file_content, type, subtype);
+ neighbourhood = new Neighbourhood;
+ neighbourhood->fromXmlString(&neighbourhood_parsers[subtype]->parse(file_content, type, subtype));
}
else if (type == "LocalFunction")
@@ -253,7 +258,8 @@
return;
}
- function_parsers[subtype]->parse(file_content, type, subtype);
+ local_function = new LocalFunction();
+ local_function->fromXmlString(&function_parsers[subtype]->parse(file_content, type, subtype));
}
else if (type == "World")
{
@@ -266,6 +272,10 @@
return;
}
+// data.clear();
+ /// @todo Fix that!
+// CalculationData* tmp_cd = new CalculationData();
+// data.append(*tmp_cd);
world_parsers[subtype]->parse(file_content, type, subtype);
}
else
@@ -282,7 +292,7 @@
QString XMLString;
QString subtype = filename.section('.', -1);
- if (!file.open(QIODevice::Truncate | QIODevice::Text))
+ if (!file.open(QIODevice::WriteOnly | QIODevice::Text))
{
qDebug(tr("Error opnening file %1.")
.arg(filename)
@@ -303,7 +313,7 @@
return;
}
- neighbourhood_parsers[subtype]->parseOut(neighbourhood->toXmlString(), type, subtype);
+ file.write(neighbourhood_parsers[subtype]->parseOut(neighbourhood->toXmlString(), type, subtype));
}
else if (type == "LocalFunction")
@@ -512,10 +522,50 @@
void MainWindow::on_action_Neighbourhood_save_activated()
{
- qDebug("UngaBunga!!!!!");
- callSaver("A cokolwiek", "Neighbourhood");
+ if(neighbourhood_parsers.count() == 0)
+ {
+ QMessageBox::warning(
+ /*parent*/ this,
+ /*title*/ tr("Plugins warning"),
+ /*message*/ tr("There are no plugins loaded to handle Neighbourhood saving.")
+ );
+ return;
+ }
+
+ QFileDialog fd(
+ /*parent*/ this,
+ /*cation*/ tr("Save Neighbourhood"),
+ /*dir*/ "."
+ );
+
+ fd.setAcceptMode(QFileDialog::AcceptSave);
+ fd.setFileMode(QFileDialog::AnyFile);
+
+ QStringList filters;
+ QString filter;
+ // Add filter in format %{name} files (*.%{name})
+ foreach(QString key, neighbourhood_parsers.keys())
+ {
+ // Don't shorten this, as it is made for translations
+ // purposes
+ filter = key + " " + tr("files") + " (*." + key + ")";
+ filters << filter;
+ }
+ fd.setFilters(filters);
+ fd.setDefaultSuffix("N");
+
+ if(fd.exec())
+ {
+ if(!fd.selectedFiles().isEmpty())
+ {
+ callSaver(fd.selectedFiles().first(), "Neighbourhood");
+
+ }
+
+ }
+
}
void MainWindow::on_action_Function_save_activated()
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <le...@us...> - 2007-01-07 20:55:19
|
Revision: 117
http://svn.sourceforge.net/qcell/?rev=117&view=rev
Author: lessm
Date: 2007-01-07 12:55:11 -0800 (Sun, 07 Jan 2007)
Log Message:
-----------
- try this
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-07 20:53:26 UTC (rev 116)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-07 20:55:11 UTC (rev 117)
@@ -281,7 +281,7 @@
data.clear();
data.append((CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt());
CalculationData* cd = sw->getStorage();
- cd = data.first();
+ *cd = *data.first();
/// @todo Nasty - get that code out of here !
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-01-07 21:30:22
|
Revision: 121
http://svn.sourceforge.net/qcell/?rev=121&view=rev
Author: dhubleizh
Date: 2007-01-07 13:30:21 -0800 (Sun, 07 Jan 2007)
Log Message:
-----------
- the right way of doing things! :>
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-07 21:29:30 UTC (rev 120)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-07 21:30:21 UTC (rev 121)
@@ -278,10 +278,8 @@
}
/// @todo Fix that!
- data.clear();
- data.append((CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt());
- CalculationData* cd = sw->getStorage();
- *cd = *data.first();
+ CalculationData* cd = (CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt();
+ *sw->getStorage() = *cd;
/// @todo Nasty - get that code out of here !
}
else
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-01-08 06:35:00
|
Revision: 125
http://svn.sourceforge.net/qcell/?rev=125&view=rev
Author: dhubleizh
Date: 2007-01-07 22:34:57 -0800 (Sun, 07 Jan 2007)
Log Message:
-----------
- KI saving corrected
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-07 23:31:53 UTC (rev 124)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-08 06:34:57 UTC (rev 125)
@@ -343,7 +343,7 @@
}
/// @todo Wait for toXmlString
- file.write(world_parsers[subtype]->parseOut(data.last()->createXmlHeader(), type, subtype));
+ file.write(world_parsers[subtype]->parseOut(sw->getStorage()->createXmlHeader(), type, subtype));
}
else
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-01-10 21:13:28
|
Revision: 145
http://svn.sourceforge.net/qcell/?rev=145&view=rev
Author: dhubleizh
Date: 2007-01-10 13:13:26 -0800 (Wed, 10 Jan 2007)
Log Message:
-----------
- some additional timer comments
- changed old // TODO: into doxygen
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-10 21:09:28 UTC (rev 144)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-10 21:13:26 UTC (rev 145)
@@ -116,7 +116,7 @@
void MainWindow::on_action_Quit_activated()
{
- // TODO: Some saving checking
+ /// @todo Some saving checking
QCoreApplication::exit();
}
@@ -477,11 +477,14 @@
void MainWindow::oneStep(int direction)
{
+ // Used to derermin how long the calculation took place.
+ // Needed for delay calculation.
QTime t;
switch (direction)
{
case Forward:
{
+ // Start the calculation timing
t.start();
if((iteration + 1) >= data.count())
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-01-12 16:51:16
|
Revision: 153
http://svn.sourceforge.net/qcell/?rev=153&view=rev
Author: dhubleizh
Date: 2007-01-12 08:51:11 -0800 (Fri, 12 Jan 2007)
Log Message:
-----------
- old CalculationData code removed
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-12 16:47:57 UTC (rev 152)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-12 16:51:11 UTC (rev 153)
@@ -352,14 +352,7 @@
data.append((CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt());
*sw->getStorage() = *data.last();
-// calc.setForeignDataPointer((char*)data.first()->getDataPointer());
- *(CalculationData*)&calc = *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);
-
+
// Enable saving menu for World
menu_Save->setEnabled(true);
action_World_save->setEnabled(true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-01-12 18:08:22
|
Revision: 155
http://svn.sourceforge.net/qcell/?rev=155&view=rev
Author: dhubleizh
Date: 2007-01-12 10:08:16 -0800 (Fri, 12 Jan 2007)
Log Message:
-----------
- brought back wrongly removed calculator initialization from rev. 152
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-12 17:40:46 UTC (rev 154)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-12 18:08:16 UTC (rev 155)
@@ -352,7 +352,8 @@
data.append((CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt());
*sw->getStorage() = *data.last();
-
+ *(CalculationData*)&calc = *data.last();
+
// Enable saving menu for World
menu_Save->setEnabled(true);
action_World_save->setEnabled(true);
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-01-17 15:43:33
|
Revision: 182
http://svn.sourceforge.net/qcell/?rev=182&view=rev
Author: dhubleizh
Date: 2007-01-17 07:43:02 -0800 (Wed, 17 Jan 2007)
Log Message:
-----------
- proper forward and bacword stepping
- dynamic KI loading tested
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-17 12:14:39 UTC (rev 181)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-17 15:43:02 UTC (rev 182)
@@ -350,12 +350,14 @@
return;
}
+ // Internal data settings
data.append((CalculationData*)world_parsers[subtype]->parse(file_content, type, subtype).toInt());
- //*sw->getStorage() = *data.last();
-
*(CalculationData*)&calc = *data.last();
- sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1);
+ iteration=0;
+ // visualization update
+ update();
+
// Enable saving menu for World
menu_Save->setEnabled(true);
action_World_save->setEnabled(true);
@@ -509,6 +511,7 @@
}
iteration--;
+ calc = *data[iteration];
}
}
@@ -530,10 +533,9 @@
void MainWindow::update()
{
- calc.getSize();
- //*sw->getStorage() = *data[iteration];
- //sw->getStorage()->resizeData(data[iteration-1]->getSize(), data[iteration-1]->getDataPointer(), 1);
- sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1);
+// *sw->getStorage() = *data[iteration];
+sw->getStorage()->resizeData(data[iteration]->getSize(), data[iteration]->getDataPointer(), 1);
+// sw->getStorage()->resizeData(calc.getSize(), calc.getDataPointer(), 1);
iterationLCD->display(iteration);
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-01-20 16:23:27
|
Revision: 211
http://svn.sourceforge.net/qcell/?rev=211&view=rev
Author: dhubleizh
Date: 2007-01-20 08:23:25 -0800 (Sat, 20 Jan 2007)
Log Message:
-----------
- agregated default filters for N, LF and CD
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-20 16:16:59 UTC (rev 210)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-20 16:23:25 UTC (rev 211)
@@ -143,15 +143,20 @@
fd.setFileMode(QFileDialog::ExistingFile);
QStringList filters;
+ QString default_filter(tr("Supported neighbourhoods"));
+ default_filter.append(" (");
QString filter;
// Add filter in format %{name} files (*.%{name})
foreach(QString key, neighbourhood_parsers.keys())
{
// Don't shorten this, as it is made for translations
// purposes
+ default_filter.append("*." + key + ' ');
filter = key + " " + tr("files") + " (*." + key + ")";
filters << filter;
}
+ default_filter.append(')');
+ filters.prepend(default_filter);
fd.setFilters(filters);
if(fd.exec())
@@ -186,15 +191,20 @@
fd.setFileMode(QFileDialog::ExistingFile);
QStringList filters;
+ QString default_filter(tr("Supported functions"));
+ default_filter.append(" (");
QString filter;
// Add filter in format %{name} files (*.%{name})
foreach(QString key, function_parsers.keys())
{
// Don't shorten this, as it is made for translations
// purposes
+ default_filter.append("*." + key + ' ');
filter = key + " " + tr("files") + " (*." + key + ")";
filters << filter;
}
+ default_filter.append(')');
+ filters.prepend(default_filter);
fd.setFilters(filters);
if(fd.exec())
@@ -230,15 +240,20 @@
fd.setFileMode(QFileDialog::ExistingFile);
QStringList filters;
+ QString default_filter(tr("Supported worlds"));
+ default_filter.append(" (");
QString filter;
// Add filter in format %{name} files (*.%{name})
foreach(QString key, world_parsers.keys())
{
// Don't shorten this, as it is made for translations
// purposes
+ default_filter.append("*." + key + ' ');
filter = key + " " + tr("files") + " (*." + key + ")";
filters << filter;
}
+ default_filter.append(')');
+ filters.prepend(default_filter);
fd.setFilters(filters);
if(fd.exec())
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-01-24 15:35:29
|
Revision: 248
http://svn.sourceforge.net/qcell/?rev=248&view=rev
Author: dhubleizh
Date: 2007-01-24 07:35:25 -0800 (Wed, 24 Jan 2007)
Log Message:
-----------
- continuous experiment bug fixed
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-24 15:12:54 UTC (rev 247)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-24 15:35:25 UTC (rev 248)
@@ -805,14 +805,14 @@
// No need to put it into MainWindow, as it isn't used there
static int iterations = 10;
ExperimentSetup es;
- es.delaySpinBox->setValue((long)msec_delay/100.00);
+// es.delaySpinBox->setValue((long)msec_delay/100.00);
es.iterationsSpinBox->setValue(iterations);
if(es.exec() == QDialog::Accepted)
{
working = true;
// msec_delay = (uint)(es.delaySpinBox->value() * 100.00);
- delaySpinBox->setValue(es.delaySpinBox->value());
+// delaySpinBox->setValue(es.delaySpinBox->value());
if(es.continiuosCheckBox->isChecked())
{
continousSteps();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-01-25 15:52:46
|
Revision: 257
http://svn.sourceforge.net/qcell/?rev=257&view=rev
Author: dhubleizh
Date: 2007-01-25 07:52:38 -0800 (Thu, 25 Jan 2007)
Log Message:
-----------
- gcc compilation bug resolved (proper cast)
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-01-25 15:48:29 UTC (rev 256)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-01-25 15:52:38 UTC (rev 257)
@@ -1227,7 +1227,8 @@
// Setup Neighbourhood editor
//***************************************************
- *(sw->getNeighbourhoodEditor()->getStorage()) = neighbourhood->toCalculationData();
+ // This really needs to be so complicated to compile on gcc 4.2
+ *sw->getNeighbourhoodEditor()->getStorage() = *((CalculationData*)&neighbourhood->toCalculationData());
sw->getNeighbourhoodEditor()->setTranslation(0.0f, 0.0f, -10.0f);
sw->getNeighbourhoodEditor()->setSymbolColor(1, QColor(128, 128, 128));
nStartPos = neighbourhood->getMinNeighbourhoodValues();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-02-13 17:32:07
|
Revision: 317
http://svn.sourceforge.net/qcell/?rev=317&view=rev
Author: dhubleizh
Date: 2007-02-13 09:24:47 -0800 (Tue, 13 Feb 2007)
Log Message:
-----------
- 2DTextTools in 3D KI
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-02-13 16:26:59 UTC (rev 316)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-02-13 17:24:47 UTC (rev 317)
@@ -1599,6 +1599,7 @@
{
sw->ui.tabWidget->setCurrentIndex(0);
dock3D->setEnabled(true);
+ dock2D->setEnabled(true);
break;
}
case 2:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <dhu...@us...> - 2007-02-16 22:38:22
|
Revision: 340
http://svn.sourceforge.net/qcell/?rev=340&view=rev
Author: dhubleizh
Date: 2007-02-16 14:37:59 -0800 (Fri, 16 Feb 2007)
Log Message:
-----------
- get rid of qDebug while loading KI
Modified Paths:
--------------
trunk/qcell/visgui/MainWindow.cpp
Modified: trunk/qcell/visgui/MainWindow.cpp
===================================================================
--- trunk/qcell/visgui/MainWindow.cpp 2007-02-16 22:32:17 UTC (rev 339)
+++ trunk/qcell/visgui/MainWindow.cpp 2007-02-16 22:37:59 UTC (rev 340)
@@ -466,8 +466,7 @@
}
file_content = file.readAll();
- qDebug()<<file_content;
- file.close();
+ file.close();
if (type == "Neighbourhood")
{
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|