Skip to content

Commit

Permalink
Fixed - Use of global variables in partitions was broken since they w…
Browse files Browse the repository at this point in the history
…ere never executed (and initialised).
  • Loading branch information
t.youngs committed Nov 2, 2011
1 parent bc4bb68 commit da82251
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
4 changes: 4 additions & 0 deletions TODO
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<h1>Known Bugs</h1>

<ul>
<li>Dialog widget values cannot easily bet set now - create widgets at parse time?</li>
<li>Dialogs are displayed after load when loading models from CLI, and dialog 'ghost' always appears no matter what</li>
<li>Closing a loaded forcefield while atom type names are displayed on atoms causes crash</li>
<li>Function arguments can be passed to array-requiring paths without complaint (e.g. old p.com, now a function)</li>
<li>Rebonding model also folds atoms, making --nofold irrelevant</li>
Expand All @@ -16,6 +18,8 @@
<h1>Current TODO</h1>

<ul>
<li>Context-sensitivity of messages - e.g. pattern name (select pattern atoms), failed pattern creation (select bad atom)</li>
<li>Easier access (menu items?) to atom shift and reorder commands</li>
<li>Saving of movies for vibrations.</li>
<li>PovRay export</li>
<li>Save forcefield needs to be able to distinguish between types and uatypes, and 'convert' data is not yet written.</li>
Expand Down
8 changes: 4 additions & 4 deletions data/partitions/cylinderz
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ int finegrid[3] = { 100,100,100 };
int npartitions = 2;

# A partition may contain options set through the defaultDialog as follows
global double x = 0.5, y = 0.5, r = 0.1;
global double x = 0.5, y = 0.5, r = 0.2;
int partitionOptions()
{
Dialog ui = createDialog("CylinderX Scheme Options");
Expand All @@ -20,9 +20,9 @@ int partitionOptions()
ui.addDoubleSpin("r", "R", 0.001, 1.0, 0.1, r);
if (ui.show())
{
x = ui.asInteger("x");
y = ui.asInteger("y");
r = ui.asInteger("r");
x = ui.asDouble("x");
y = ui.asDouble("y");
r = ui.asDouble("r");
return TRUE;
}
else return FALSE;
Expand Down
7 changes: 4 additions & 3 deletions src/main/aten_partitions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,17 @@ bool Aten::openPartition(const char *filename)
// Construct partitions Program...
PartitioningScheme *ps = partitioningSchemes_.add();
bool success = ps->schemeDefinition().generateFromFile(filename, filename, FALSE);
if (success) success = ps->initialise();
// if (success) success =

if (success)
if ((!success) || (!ps->initialise()))
{
msg.print("Failed to load Partitions from '%s'...\n", filename);
msg.print("Failed to load partition from '%s'...\n", filename);
failedPartitioningSchemes_.add()->set( filename );
partitioningSchemes_.remove(ps);
msg.exit("Aten::openPartition");
return FALSE;
}

msg.exit("Aten::openPartition");
return TRUE;
}
Expand Down
4 changes: 2 additions & 2 deletions src/main/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
#define ATEN_VERSION_H

#define ATENVERSION "1.8"
#define ATENREVISION "1753"
#define ATENDATE "Mon 31 Oct - 10:45"
#define ATENREVISION "1754"
#define ATENDATE "Wed 02 Nov - 15:50"
#define ATENURL "http://aten.googlecode.com/svn/trunk"

#endif
7 changes: 7 additions & 0 deletions src/methods/partition.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,13 @@ bool PartitioningScheme::initialise()
}
else hasOptions_ = FALSE;

// Run main partition tree so all variables / globals are set
if (!schemeDefinition_.mainProgram()->execute(rv))
{
msg.print("Error: Failed to run through partitioning scheme code.\n");
return FALSE;
}

// Now can set up basic partition list
partitions_.clear();
for (int n = 0; n<nparts; ++n)
Expand Down

0 comments on commit da82251

Please sign in to comment.