[Avida-cvs] [avida-svn] r768 - branches/developers/avida-edward/source/python/AvidaGui2
jclune@myxo.css.msu.edu
jclune at myxo.css.msu.edu
Thu Jun 22 13:38:05 PDT 2006
Author: jclune
Date: 2006-06-22 16:38:05 -0400 (Thu, 22 Jun 2006)
New Revision: 768
Modified:
branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
branches/developers/avida-edward/source/python/AvidaGui2/pyFreezerCtrl.py
branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py
branches/developers/avida-edward/source/python/AvidaGui2/to-do_list
Log:
Petri dish now repaints on reload. And bug fixed regarding restarting runs by accident when viewing dish. And scroll bars are back.
Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py 2006-06-22 20:36:34 UTC (rev 767)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py 2006-06-22 20:38:05 UTC (rev 768)
@@ -29,6 +29,13 @@
self.m_freezer_ctrl.construct(session_mdl)
self.m_cli_to_ctrl_dict = {}
self.m_ctrl_to_cli_dict = {}
+ print "conecting initiaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaalize"
+ self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("initializeWithDefaultPetriDishSig"),
+ self.Restart_ExpActionSlot)
+
+
+
+
if (session_mdl.directory_chosen == False):
self.setCaption('%s - %s' % (avida_ed_version_string, "Unnamed Workspace") )
else:
@@ -110,7 +117,6 @@
self.connect(self.controlRestart_ExpAction,SIGNAL("activated()"),
self.Restart_ExpActionSlot)
-
self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("addStatusBarWidgetSig"), self.addStatusBarWidgetSlot)
self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("removeStatusBarWidgetSig"), self.removeStatusBarWidgetSlot)
self.connect(self.m_session_mdl.m_session_mdtr, PYSIGNAL("statusBarMessageSig"), self.statusBarMessageSlot)
@@ -431,9 +437,9 @@
self.emit(PYSIGNAL("quitAvidaPhaseIISig"), ())
def Restart_ExpActionSlot(self):
-
+ print "in restarttttttttttttttttttttttttttttttttttttt"
# If the user clicks the repopulate button pretend that they double
- # the default empty petri dish from the freezer
+ # click the default empty petri dish from the freezer
file_name = os.path.join(self.m_session_mdl.m_current_freezer,
"@default.empty")
Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyFreezerCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyFreezerCtrl.py 2006-06-22 20:36:34 UTC (rev 767)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyFreezerCtrl.py 2006-06-22 20:38:05 UTC (rev 768)
@@ -22,6 +22,7 @@
self.m_session_mdl = session_mdl
def contentsDropEvent(self, e):
+ print "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
descr(e)
freezer_item_name = QString()
if e.source() is self:
@@ -275,6 +276,8 @@
thawed_item = pyReadFreezer(file_name)
self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("doDefrostDishSig"),
(item.text(0), thawed_item,))
+ print "item.text(0) is ", item.text(0)
+ print "thawed_item is ", thawed_item
self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("freezerItemDoubleClicked"),
(file_name,))
Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py 2006-06-22 20:36:34 UTC (rev 767)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py 2006-06-22 20:38:05 UTC (rev 768)
@@ -22,6 +22,7 @@
self.m_session_mdl = session_mdl
self.m_avida = None
self.dishDisabled = False
+
self.m_petri_dish_ctrl.construct(self.m_session_mdl)
@@ -62,6 +63,9 @@
self.m_map_profile = pyMapProfile(self.m_session_mdl)
for i in range(self.m_map_profile.getSize()):
self.m_mode_combobox.insertItem(self.m_map_profile.getModeName(i))
+ print "emiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiting"
+ self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("initializeWithDefaultPetriDishSig"),())
+
# Start with second map mode -- "Fitness".
self.m_mode_combobox.setCurrentItem(2)
@@ -111,12 +115,13 @@
QToolTip.remove(self.m_petri_dish_toggle)
QToolTip.add(self.m_petri_dish_toggle,
"Flip to see the <b><i>Environmental Settings</i></b>")
- self.m_session_mdl.m_session_mdtr.emit(
- PYSIGNAL("doInitializeAvidaPhaseISig"),
- (self.m_session_mdl.m_tempdir,))
+ if (self.dishDisabled == False):
+ self.m_session_mdl.m_session_mdtr.emit(
+ PYSIGNAL("doInitializeAvidaPhaseISig"),
+ (self.m_session_mdl.m_tempdir,))
- def MakeConfigVisiableSlot (self):
+ def MakeConfigVisibleSlot (self):
if self.dishDisabled:
return
current_page = self.m_petri_dish_widget_stack.visibleWidget()
@@ -207,16 +212,19 @@
current_page = self.m_petri_dish_widget_stack.visibleWidget()
current_page_int = self.m_petri_dish_widget_stack.id(current_page)
- self.MakeConfigVisiableSlot()
+ self.MakeConfigVisibleSlot()
def DefrostSlot(self, dish_name, petri_dict):
- descr()
- if self.isVisible():
+ descr()
+# if self.isVisible():
+ print "QQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQQ"
+ print "self is ", self
+
Restart_Only_Flag = False
# If the petri dish is already filled prompt the user if they want to
# freeze the existing dish
-
+
if self.m_petri_configure_ctrl.DishDisabled:
self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("doPauseAvidaSig"), ())
@@ -240,7 +248,7 @@
return
self.RenameDishSlot(dish_name)
- self.MakeConfigVisiableSlot()
+ self.MakeConfigVisibleSlot()
self.finishedPetriDish = False
self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("FillDishSig"),
(dish_name, petri_dict, ))
Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py 2006-06-22 20:36:34 UTC (rev 767)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py 2006-06-22 20:38:05 UTC (rev 768)
@@ -63,8 +63,8 @@
self.m_petri_dish_ctrl_h_scrollBar = QScrollBar(0,371,0,20,185,Qt.Horizontal,self.m_canvas_view)
self.m_petri_dish_ctrl_v_scrollBar = QScrollBar(0,371,0,20,185,Qt.Vertical,self.m_canvas_view)
# end junk settings
- self.m_petri_dish_ctrl_h_scrollBar.setGeometry(0,371, 371,self.m_scroll_bar_width)
- self.m_petri_dish_ctrl_v_scrollBar.setGeometry(371,0,self.m_scroll_bar_width,371)
+ self.m_petri_dish_ctrl_h_scrollBar.setGeometry(0,354, 371,self.m_scroll_bar_width)
+ self.m_petri_dish_ctrl_v_scrollBar.setGeometry(354,0,self.m_scroll_bar_width,354)
self.m_petri_dish_layout.addWidget(self.m_canvas_view)
self.m_changed_cell_items = []
@@ -123,6 +123,20 @@
self.m_map_cell_width,
self.m_canvas)
+ #@JMC delete this...just testing something
+ def createNewPseudoCellItem(self, n):
+ #self.m_occupied_cells_ids.append(n)
+ return pyPopulationCellItem(
+ None,
+ (n%self.m_world_w) * self.m_map_cell_width,
+ (n/self.m_world_w) * self.m_map_cell_width,
+ self.m_map_cell_width,
+ self.m_map_cell_width,
+ self.m_canvas)
+
+
+
+
def setAvidaSlot(self, avida):
print "pyPetriDishCtrl.setAvidaSlot() ..."
old_avida = self.m_avida
@@ -160,7 +174,9 @@
self.m_background_rect.setPen(QPen(Qt.black))
self.m_background_rect.show()
self.m_background_rect.setZ(0.0)
+ print "COULD PAINT CELLS HERE"
+
if self.m_cell_info: del self.m_cell_info
self.m_cell_info = [None] * self.m_world_w * self.m_world_h
self.m_occupied_cells_ids = []
@@ -170,6 +186,8 @@
self.m_cs_value_range = 0
self.m_changed_cell_items = self.m_cell_info[:]
self.updateCellItems(True)
+ print "Trying to paint cells HERE"
+# self.updatePseudoCellItem(465)
def setDragSlot(self, org_clicked_on_item = None):
descr(org_clicked_on_item)
@@ -213,6 +231,19 @@
cell_info_item.setPen(QPen(QColor(0,255,0)))
self.m_last_cell_outlined = cell_info_item
+ #delete @JMC just testing
+ def updatePseudoCellItem(self, cell_id):
+ if self.m_cell_info[cell_id] is None:
+ self.m_cell_info[cell_id] = self.createNewPseudoCellItem(cell_id)
+ cell_info_item = self.m_cell_info[cell_id]
+ self.m_indexer(cell_info_item, self.m_cs_min_value, self.m_cs_value_range)
+ cell_info_item.updateColorUsingFunctor(self.m_color_lookup_functor)
+
+ if self.m_org_clicked_on_item:
+ if cell_info_item.m_population_cell.GetID == self.m_org_clicked_on_item.m_population_cell.GetID:
+ cell_info_item.setPen(QPen(QColor(0,255,0)))
+ self.m_last_cell_outlined = cell_info_item
+
def updateCellItems(self, should_update_all = False):
if self.m_cell_info:
Modified: branches/developers/avida-edward/source/python/AvidaGui2/to-do_list
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/to-do_list 2006-06-22 20:36:34 UTC (rev 767)
+++ branches/developers/avida-edward/source/python/AvidaGui2/to-do_list 2006-06-22 20:38:05 UTC (rev 768)
@@ -177,4 +177,3 @@
16-Jan-06 Get Windows version working -- Finished 21-Feb-06
29-Apr-06 Export Excel style (comma delimited) files -- Finished 06-Jun-06
30-May-06 Printing of petri dish and of color scale -- Finished 06-Jun-06
-06-Jun-06 Change .csv to .txt extension in export dialog -- Finished 19-Jun-06
More information about the Avida-cvs
mailing list