[Avida-cvs] [Avida2-svn] r82 - trunk/source/python/AvidaGui2
baerb at myxo.css.msu.edu
baerb at myxo.css.msu.edu
Wed Mar 30 10:34:42 PST 2005
Author: baerb
Date: 2005-03-30 13:34:42 -0500 (Wed, 30 Mar 2005)
New Revision: 82
Modified:
trunk/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
trunk/source/python/AvidaGui2/pyEduWorkspaceView.ui
trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py
trunk/source/python/AvidaGui2/pyPetriConfigureView.ui
trunk/source/python/AvidaGui2/pySessionCtrl.py
trunk/source/python/AvidaGui2/pyWriteGenesis.py
Log:
some changes to interface
created a workspce directory which contains the freezer -- this is still pretty
ugly.
Modified: trunk/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyEduWorkspaceCtrl.py 2005-03-30 17:23:16 UTC (rev 81)
+++ trunk/source/python/AvidaGui2/pyEduWorkspaceCtrl.py 2005-03-30 18:34:42 UTC (rev 82)
@@ -54,7 +54,7 @@
self.connect(self.m_nav_bar_ctrl.m_list_view, SIGNAL("clicked(QListViewItem *)"), self.navBarItemClickedSlot)
self.connect(self.m_widget_stack, SIGNAL("aboutToShow(QWidget *)"), self.ctrlAboutToShowSlot)
- self.connect(self.fileOpenFreezerAction,SIGNAL("activated()"),self.freezerOpenSlot)
+ # self.connect(self.fileOpenFreezerAction,SIGNAL("activated()"),self.freezerOpenSlot)
self.connect(self.controlNext_UpdateAction,SIGNAL("activated()"),self.next_UpdateActionSlot)
self.connect(self.controlStartAction,SIGNAL("activated()"),self.startActionSlot)
self.connect(
@@ -67,6 +67,19 @@
self.m_session_mdl.m_session_mdtr, PYSIGNAL("doStartAvidaSig"),
self.doStartAvidaSlot)
+ self.connect(
+ self.m_session_mdl.m_session_mdtr.m_edu_session_menu_bar_hdlr_mdtr,
+ PYSIGNAL("doStartSig"),
+ self.doStartAvidaSlot)
+ self.connect(
+ self.m_session_mdl.m_session_mdtr.m_edu_session_menu_bar_hdlr_mdtr,
+ PYSIGNAL("doPauseSig"),
+ self.doPauseAvidaSlot)
+ # self.connect(
+ # self.m_session_mdl.m_session_mdtr.m_edu_session_menu_bar_hdlr_mdtr,
+ # PYSIGNAL("doNextUpdateSig"),
+ # self.updatePBClickedSlot)
+
self.m_nav_bar_ctrl.m_one_population_cli.setState(QCheckListItem.On)
self.m_widget_stack.raiseWidget(self.m_one_population_ctrl)
@@ -116,7 +129,18 @@
# public slot
def fileOpen(self):
- print "pyEduWorkspaceCtrl.fileOpen(): Not implemented yet"
+ workspace_dir = QFileDialog.getExistingDirectory(
+ self.m_session_mdl.m_current_workspace,
+ None,
+ "get existing directory",
+ "Choose a directory",
+ True);
+ workspace_dir = str(workspace_dir)
+ if workspace_dir.strip() != "":
+ self.m_session_mdl.m_current_workspce = str(workspace_dir) + "/"
+ self.m_session_mdl.m_current_freezer = self.m_session_mdl.m_current_workspce + "freezer/"
+ self.m_session_mdl.m_session_mdtr.emit(
+ PYSIGNAL("doRefreshFreezerInventory"), ())
# public slot
@@ -127,9 +151,11 @@
"get existing directory",
"Choose a directory",
True);
- self.m_session_mdl.m_current_freezer = str(freezer_dir) + "/"
- self.m_session_mdl.m_session_mdtr.emit(
- PYSIGNAL("doRefreshFreezerInventory"), ())
+ freezer_dir = str(freezer_dir)
+ if freezer_dir.strip() != "":
+ self.m_session_mdl.m_current_freezer = str(freezer_dir) + "/"
+ self.m_session_mdl.m_session_mdtr.emit(
+ PYSIGNAL("doRefreshFreezerInventory"), ())
# public slot
Modified: trunk/source/python/AvidaGui2/pyEduWorkspaceView.ui
===================================================================
--- trunk/source/python/AvidaGui2/pyEduWorkspaceView.ui 2005-03-30 17:23:16 UTC (rev 81)
+++ trunk/source/python/AvidaGui2/pyEduWorkspaceView.ui 2005-03-30 18:34:42 UTC (rev 82)
@@ -109,7 +109,7 @@
<item text="&File" name="File">
<action name="fileNewAction"/>
<action name="fileOpenAction"/>
- <action name="fileClose_WorkspaceAction"/>
+ <!-- <action name="fileClose_WorkspaceAction"/> -->
<action name="fileOpenFreezerAction"/>
<separator/>
<action name="fileSaveAction"/>
@@ -558,14 +558,14 @@
<string>Minimize Window</string>
</property>
</action>
- <action>
+ <!-- <action>
<property name="name">
<cstring>fileOpenFreezerAction</cstring>
</property>
<property name="text">
<string>Open Freezer</string>
</property>
- </action>
+ </action> -->
</actions>
<images>
<image name="image0">
Modified: trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py 2005-03-30 17:23:16 UTC (rev 81)
+++ trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py 2005-03-30 18:34:42 UTC (rev 82)
@@ -167,6 +167,7 @@
def CreateFilesFromPetriSlot(self, out_dir = None):
self.full_petri_dict["SETTINGS"] = self.Form2Dictionary()
write_object = pyWriteGenesis(self.full_petri_dict,
+ self.m_session_mdl.m_current_workspace,
self.m_session_mdl.m_current_freezer, self.m_session_mdl.m_tempdir)
self.m_session_mdl.m_session_mdtr.emit(
PYSIGNAL("doInitializeAvidaPhaseIISig"), (self.m_session_mdl.m_tempdir + "genesis.avida",))
Modified: trunk/source/python/AvidaGui2/pyPetriConfigureView.ui
===================================================================
--- trunk/source/python/AvidaGui2/pyPetriConfigureView.ui 2005-03-30 17:23:16 UTC (rev 81)
+++ trunk/source/python/AvidaGui2/pyPetriConfigureView.ui 2005-03-30 18:34:42 UTC (rev 82)
@@ -8,8 +8,8 @@
<rect>
<x>0</x>
<y>0</y>
- <width>398</width>
- <height>666</height>
+ <width>377</width>
+ <height>591</height>
</rect>
</property>
<property name="font">
@@ -33,6 +33,22 @@
<property name="spacing">
<number>2</number>
</property>
+ <widget class="QLabel">
+ <property name="name">
+ <cstring>textLabel1</cstring>
+ </property>
+ <property name="font">
+ <font>
+ <pointsize>11</pointsize>
+ </font>
+ </property>
+ <property name="text">
+ <string>Environmental Settings</string>
+ </property>
+ <property name="alignment">
+ <set>AlignCenter</set>
+ </property>
+ </widget>
<widget class="QFrame">
<property name="name">
<cstring>SliderFrame</cstring>
@@ -49,7 +65,7 @@
</property>
<widget class="QLayoutWidget">
<property name="name">
- <cstring>layout76</cstring>
+ <cstring>layout10</cstring>
</property>
<vbox>
<property name="name">
@@ -76,7 +92,7 @@
</widget>
<widget class="QLayoutWidget">
<property name="name">
- <cstring>layout75</cstring>
+ <cstring>layout9</cstring>
</property>
<hbox>
<property name="name">
@@ -96,8 +112,11 @@
<property name="maxValue">
<number>20</number>
</property>
+ <property name="pageStep">
+ <number>1</number>
+ </property>
<property name="value">
- <number>-20</number>
+ <number>3</number>
</property>
<property name="orientation">
<enum>Horizontal</enum>
@@ -110,12 +129,20 @@
<property name="name">
<cstring>MutationPercentTextLabel</cstring>
</property>
+ <property name="sizePolicy">
+ <sizepolicy>
+ <hsizetype>0</hsizetype>
+ <vsizetype>5</vsizetype>
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<property name="font">
<font>
</font>
</property>
<property name="text">
- <string>0.01 %</string>
+ <string>3 %</string>
</property>
</widget>
</hbox>
@@ -172,10 +199,13 @@
<number>200</number>
</property>
<property name="lineStep">
- <number>10</number>
+ <number>1</number>
</property>
+ <property name="pageStep">
+ <number>1</number>
+ </property>
<property name="value">
- <number>60</number>
+ <number>30</number>
</property>
<property name="orientation">
<enum>Horizontal</enum>
@@ -193,7 +223,7 @@
</font>
</property>
<property name="text">
- <string>60 x 60 cells</string>
+ <string>30 x 30 cells</string>
</property>
</widget>
</hbox>
@@ -502,7 +532,7 @@
</font>
</property>
<property name="text">
- <string>Random Number Generator</string>
+ <string>Random Number Generator Seed</string>
</property>
<property name="alignment">
<set>AlignCenter</set>
@@ -571,7 +601,7 @@
</font>
</property>
<property name="text">
- <string>Set at</string>
+ <string>Set to</string>
</property>
</widget>
<widget class="QSpinBox">
Modified: trunk/source/python/AvidaGui2/pySessionCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pySessionCtrl.py 2005-03-30 17:23:16 UTC (rev 81)
+++ trunk/source/python/AvidaGui2/pySessionCtrl.py 2005-03-30 18:34:42 UTC (rev 82)
@@ -40,7 +40,8 @@
# Create "model" for storing state data.
class pyMdl: pass
self.m_session_mdl = pyMdl()
- self.m_session_mdl.m_current_freezer = "freezer/"
+ self.m_session_mdl.m_current_workspace = "default.workspace/"
+ self.m_session_mdl.m_current_freezer = self.m_session_mdl.m_current_workspace + "freezer/"
# Create a temporary subdirectory for general use in this session.
self.m_session_mdl.m_tempdir = tempfile.mkdtemp('','AvidaEd-pid%d-'%os.getpid()) + "/"
Modified: trunk/source/python/AvidaGui2/pyWriteGenesis.py
===================================================================
--- trunk/source/python/AvidaGui2/pyWriteGenesis.py 2005-03-30 17:23:16 UTC (rev 81)
+++ trunk/source/python/AvidaGui2/pyWriteGenesis.py 2005-03-30 18:34:42 UTC (rev 82)
@@ -4,18 +4,19 @@
class pyWriteGenesis:
- def __init__(self, in_dict = None, freeze_dir = None, out_dir = None):
+ def __init__(self, in_dict = None, workspace_dir = None, freeze_dir = None,
+ out_dir = None):
settings_dict = in_dict["SETTINGS"]
# Copies default event and environment files and adds names to the
# incoming dictionary
- shutil.copyfile("events.default", out_dir + "events.cfg")
+ shutil.copyfile(workspace_dir + "events.default", out_dir + "events.cfg")
if in_dict.has_key("CELLS"):
self.createInjects(in_dict, out_dir + "events.cfg")
- shutil.copyfile("environment.default", out_dir + "environment.cfg")
- shutil.copyfile("inst_set.default", out_dir + "inst_set.default")
+ shutil.copyfile(workspace_dir + "environment.default", out_dir + "environment.cfg")
+ shutil.copyfile(workspace_dir + "inst_set.default", out_dir + "inst_set.default")
shutil.copyfile(freeze_dir + settings_dict["START_CREATURE"],
out_dir + settings_dict["START_CREATURE"])
settings_dict["EVENT_FILE"] = out_dir + "events.cfg"
@@ -26,7 +27,7 @@
# Read the default genesis file, if there is a equivilent line in the
# dictionary replace it the new values, otherwise just copy the line
- orig_genesis_file = open("genesis.default")
+ orig_genesis_file = open(workspace_dir + "genesis.default")
lines = orig_genesis_file.readlines()
orig_genesis_file.close()
out_genesis_file = open(out_dir + "genesis.avida", "w")
More information about the Avida-cvs
mailing list