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

baerb at myxo.css.msu.edu baerb at myxo.css.msu.edu
Wed Apr 6 10:44:57 PDT 2005


Author: baerb
Date: 2005-04-06 13:44:57 -0400 (Wed, 06 Apr 2005)
New Revision: 121

Modified:
   trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
   trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py
Log:
When the user clicks on an item in the freezer the program will no longer 
change the petri dish name and the petri dish configuration once a run is going.



Modified: trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py	2005-04-06 17:34:52 UTC (rev 120)
+++ trunk/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py	2005-04-06 17:44:57 UTC (rev 121)
@@ -13,6 +13,7 @@
   def construct(self, session_mdl):
     self.m_session_mdl = session_mdl
     self.m_avida = None
+    self.dishDisabled = False
     self.m_petri_dish_ctrl.construct(self.m_session_mdl)
     self.m_gradient_scale_ctrl.construct(self.m_session_mdl)
     self.m_live_controls_ctrl.construct(self.m_session_mdl)
@@ -29,7 +30,9 @@
       PYSIGNAL("doDefrostDishSig"), self.RenameDishSlot)
     self.connect(self.m_session_mdl.m_session_mdtr,
       PYSIGNAL("doDefrostDishSig"), self.MakeConfigVisiableSlot)
-
+    self.connect(self.m_session_mdl.m_session_mdtr,
+      PYSIGNAL("doDisablePetriDishSig"), self.SetDishDisabledSlot)
+      
     self.connect(self.m_zoom_spinbox, SIGNAL("valueChanged(int)"),
       self.m_petri_dish_ctrl.zoomSlot)
     self.connect(self.m_petri_dish_ctrl, PYSIGNAL("zoomSig"),
@@ -73,10 +76,15 @@
        self.m_petri_dish_widget_stack.raiseWidget(0)
  
   def MakeConfigVisiableSlot (self):
+    if self.dishDisabled:
+      return
     current_page = self.m_petri_dish_widget_stack.visibleWidget()
     current_page_int = self.m_petri_dish_widget_stack.id(current_page)
     if (current_page_int == 0):
        self.m_petri_dish_widget_stack.raiseWidget(1)
+       
+  def SetDishDisabledSlot(self):
+    self.dishDisabled = True
 
   def modeActivatedSlot(self, index):
     #print "pyOnePop_PetriDishCtrl.modeActivatedSlot index", index
@@ -117,4 +125,6 @@
     if update: self.m_update_label.setText(QString("%1").arg(update))
     
   def RenameDishSlot(self, dishName):
+    if self.dishDisabled:
+      return
     self.PopulationTextLabel.setText(dishName)

Modified: trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py
===================================================================
--- trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py	2005-04-06 17:34:52 UTC (rev 120)
+++ trunk/source/python/AvidaGui2/pyPetriConfigureCtrl.py	2005-04-06 17:44:57 UTC (rev 121)
@@ -18,6 +18,7 @@
     self.m_session_mdl = session_mdl
     self.m_session_petri_view = pyPetriConfigureView()
     self.full_petri_dict = {}
+    self.DishDisabled = False
     self.connect(self.MutationSlider, SIGNAL("valueChanged(int)"), 
       self.ChangeMutationTextSlot)
     self.connect(self.WorldSizeSlider, SIGNAL("valueChanged(int)"), 
@@ -92,6 +93,11 @@
       self.StopAtSpinBox.setEnabled(True)
   
   def FillDishSlot(self, dish_name, petri_dict):
+    
+    # Stop from filling the petri dish if the dish is disabled
+
+    if self.DishDisabled:
+      return
     self.full_petri_dict = petri_dict.dictionary
     settings_dict =  petri_dict.dictionary["SETTINGS"]
     self.AncestorComboBox.removeItem (0)
@@ -141,7 +147,6 @@
        
 
   def DisablePetriConfigureSlot(self):
-    print "called DisablePetriConfigureSlot"
     self.run_started = False
     self.AncestorComboBox.setEnabled(False)
     self.StopAtSpinBox.setEnabled(False)
@@ -168,6 +173,9 @@
     self.StopHeadTextLabel.setEnabled(False)
     self.DeathTextLabel2.setEnabled(False)
     self.DeathTextLabel3.setEnabled(False)
+    self.DishDisabled = True
+    self.m_session_mdl.m_session_mdtr.emit(
+      PYSIGNAL("doDisablePetriDishSig"), ())
 
   def CreateFilesFromPetriSlot(self, out_dir = None):
     self.full_petri_dict["SETTINGS"] = self.Form2Dictionary()
@@ -207,7 +215,8 @@
       settings_dict["DEATH_METHOD"] = 2
     return settings_dict
     
-  def FreezePetriSlot(self, freeze_dir = None, population_dict = None):
+  def FreezePetriSlot(self, freeze_dir = None, population_dict = None, 
+      send_reset_signal = False, send_quit_signal = False):
     tmp_dict = {}
     tmp_dict["SETTINGS"] = self.Form2Dictionary()
     m_pop_up_freezer_file_name = pyFreezeDialogCtrl()




More information about the Avida-cvs mailing list