[Avida-cvs] [Avida2-svn] r216 - trunk/source/python/AvidaGui2

baerb@myxo.css.msu.edu baerb at myxo.css.msu.edu
Tue Jun 21 12:19:44 PDT 2005


Author: baerb
Date: 2005-06-21 15:19:44 -0400 (Tue, 21 Jun 2005)
New Revision: 216

Modified:
   trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
   trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py
   trunk/source/python/AvidaGui2/pyPetriDishCtrl.py
Log:
Fixed minor bugs in code that calls WriteToFreezer.

Now when you drag (or double click) a petri dish from the freezer
to a running petri dish the code will ask you to freeze the curent
running petri dish.  This is the first step to starting a new run.



Modified: trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py	2005-06-21 15:48:53 UTC (rev 215)
+++ trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py	2005-06-21 19:19:44 UTC (rev 216)
@@ -22,7 +22,6 @@
     self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("freezeDishPhaseISig"), self.m_petri_dish_ctrl.extractPopulationSlot)
     self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("freezeDishPhaseISig"), self.freezeDishPhaseISlot)
 
-    self.connect(self.m_petri_configure_ctrl, PYSIGNAL("freezeDishPhaseISig"), self.m_petri_dish_ctrl.extractPopulationSlot)
     self.connect(self.m_petri_dish_ctrl, PYSIGNAL("freezeDishPhaseIISig"), self.m_petri_configure_ctrl.FreezePetriSlot)
     self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("setAvidaSig"), self.setAvidaSlot)
     self.connect(self.m_petri_dish_toggle, SIGNAL("clicked()"), self.ToggleDishSlot)

Modified: trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py	2005-06-21 15:48:53 UTC (rev 215)
+++ trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py	2005-06-21 19:19:44 UTC (rev 216)
@@ -116,7 +116,8 @@
     # Stop from filling the petri dish if the dish is disabled
 
     if self.DishDisabled:
-      return
+      self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("freezeDishPhaseISig"),())
+      # return
     self.full_petri_dict = petri_dict.dictionary
     settings_dict =  petri_dict.dictionary["SETTINGS"]
     self.AncestorComboBox.removeItem (0)
@@ -250,7 +251,7 @@
     # If the user is saving a full population expand the name and insert
     # the population dictionary into the temporary dictionary
 
-    if (m_pop_up_freezer_file_name.isEmpty() == False):
+    if (not m_pop_up_freezer_file_name.isEmpty()):
       os.mkdir(file_name)
 
       # Copy the average and count files from the teporary output directory
@@ -260,8 +261,8 @@
       shutil.copyfile(os.path.join(self.m_session_mdl.m_tempdir_out, "count.dat"), os.path.join(file_name, "count.dat"))
       file_name = os.path.join(file_name, "petri_dish")
       tmp_dict["POPULATION"] = population_dict
-    is_empty_dish = m_pop_up_freezer_file_name.EmptyRadioButton.isChecked()
-    freezer_file = pyWriteToFreezer(tmp_dict, is_empty_dish, file_name)
+      is_empty_dish = m_pop_up_freezer_file_name.EmptyRadioButton.isChecked()
+      freezer_file = pyWriteToFreezer(tmp_dict, is_empty_dish, file_name)
     
     self.m_session_mdl.m_session_mdtr.emit(
       PYSIGNAL("doRefreshFreezerInventorySig"), ())

Modified: trunk/source/python/AvidaGui2/pyPetriDishCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyPetriDishCtrl.py	2005-06-21 15:48:53 UTC (rev 215)
+++ trunk/source/python/AvidaGui2/pyPetriDishCtrl.py	2005-06-21 19:19:44 UTC (rev 216)
@@ -168,9 +168,9 @@
 
   def extractPopulationSlot(self, send_reset_signal = False, send_quit_signal = False):
     population_dict = {}
-    for x in range(self.m_world_w):
-      for y in range(self.m_world_h):
-        if self.m_avida != None:
+    if self.m_avida != None:
+      for x in range(self.m_world_w):
+        for y in range(self.m_world_h):
           cell = self.m_avida.m_population.GetCell(x + self.m_world_w*y)
           if cell.IsOccupied() == True:
             organism = cell.GetOrganism()
@@ -190,4 +190,4 @@
       else:
         m.translate(trans_h/(zoom_factor/self.m_target_dish_scaling),trans_h/(zoom_factor/self.m_target_dish_scaling))    
       self.m_canvas_view.setWorldMatrix(m)
- 
\ No newline at end of file
+ 




More information about the Avida-cvs mailing list