[Avida-cvs] [avida-svn] r703 - in branches/developers/avida-edward/source/python: AvidaGui2 scripts/win32

gerrishj@myxo.css.msu.edu gerrishj at myxo.css.msu.edu
Tue May 23 14:29:08 PDT 2006


Author: gerrishj
Date: 2006-05-23 17:29:08 -0400 (Tue, 23 May 2006)
New Revision: 703

Modified:
   branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceView.ui
   branches/developers/avida-edward/source/python/AvidaGui2/pyOneOrg_ScopeCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyOnePopulationCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py
   branches/developers/avida-edward/source/python/AvidaGui2/to-do_list
   branches/developers/avida-edward/source/python/scripts/win32/setup.py
Log:
Added icons to Windows installer.
Implemented ability to print petri dish.  Currently prints entire Petri Dish
view, need to print only scale and dish itself.


Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py	2006-05-23 05:04:43 UTC (rev 702)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceCtrl.py	2006-05-23 21:29:08 UTC (rev 703)
@@ -296,6 +296,12 @@
 
   # public slot
 
+  def filePrintPetriDish(self):
+    print "pyEduWorkspaceCtrl.filePrintPetriDish() emitting printPetriDishSig via self.m_session_mdl.m_session_mdtr"
+    self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("printPetriDishSig"), ())
+
+  # public slot
+
   def filePrint(self):
     print "pyEduWorkspaceCtrl.filePrint() emitting printGraphSig via self.m_session_mdl.m_session_mdtr"
     self.m_session_mdl.m_session_mdtr.emit(PYSIGNAL("printGraphSig"), ())

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceView.ui
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceView.ui	2006-05-23 05:04:43 UTC (rev 702)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyEduWorkspaceView.ui	2006-05-23 21:29:08 UTC (rev 703)
@@ -155,6 +155,7 @@
         <separator/>
         <action name="fileExportAction"/>
         <separator/>
+        <action name="m_petri_print_action"/>
         <action name="m_graph_print_action"/>
     </item>
     <item text="&amp;Edit" name="editMenu">
@@ -381,6 +382,23 @@
     </action>
     <action>
         <property name="name">
+            <cstring>m_petri_print_action</cstring>
+        </property>
+        <property name="iconSet">
+            <iconset>image4</iconset>
+        </property>
+        <property name="text">
+            <string>Print Petri &amp;Dish...</string>
+        </property>
+        <property name="menuText">
+            <string>Print Petri &amp;Dish...</string>
+        </property>
+        <property name="accel">
+            <string>Ctrl+D</string>
+        </property>
+    </action>
+    <action>
+        <property name="name">
             <cstring>m_graph_print_action</cstring>
         </property>
         <property name="iconSet">
@@ -749,6 +767,12 @@
         <slot>fileExport()</slot>
     </connection>
     <connection>
+        <sender>m_petri_print_action</sender>
+        <signal>activated()</signal>
+        <receiver>pyEduWorkspaceView</receiver>
+        <slot>filePrintPetriDish()</slot>
+    </connection>
+    <connection>
         <sender>m_graph_print_action</sender>
         <signal>activated()</signal>
         <receiver>pyEduWorkspaceView</receiver>

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOneOrg_ScopeCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOneOrg_ScopeCtrl.py	2006-05-23 05:04:43 UTC (rev 702)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOneOrg_ScopeCtrl.py	2006-05-23 21:29:08 UTC (rev 703)
@@ -14,10 +14,9 @@
     self.m_organism_scope_ctrl.construct(self.m_session_mdl)
     self.m_execution_step_slider.setMinValue(0)
     self.m_execution_step_slider.setMaxValue(0)
-#    self.m_clock = qt.QTime()
     self.m_timer = qt.QTimer()
     self.m_next = qt.QTimer()
-    self.m_timer_interval = 250
+    self.m_timer_interval = 100
 
     self.connect(
       self.m_execution_step_slider, qt.SIGNAL("valueChanged(int)"),
@@ -54,7 +53,7 @@
 
 
   def sliderValueChangedSlot(self, frame_number):
-    print "pyOneOrg_ScopeCtrl.sliderValueChangedSlot(", frame_number, ")."
+#    print "pyOneOrg_ScopeCtrl.sliderValueChangedSlot(", frame_number, ")."
     self.m_organism_scope_ctrl.showFrame(frame_number)
 
 
@@ -92,7 +91,6 @@
     print "pyOneOrg_ScopeCtrl.playSlot()."
     self.m_analyze_controls_ctrl.m_widget_stack.raiseWidget(self.m_analyze_controls_ctrl.m_pause_page)
     self.m_timer.start(self.m_timer_interval, False)
-#    self.m_clock.start()
 
   def advanceSlot(self):
     #print "pyOneOrg_ScopeCtrl.advanceSlot()."
@@ -101,4 +99,3 @@
       self.pauseSlot()
     else:
       self.m_execution_step_slider.setValue(slider_value + 1)
-#        self.m_timer.start(min(0, self.m_timer_interval - self.m_clock.restart(), True))

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py	2006-05-23 05:04:43 UTC (rev 702)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOnePop_PetriDishCtrl.py	2006-05-23 21:29:08 UTC (rev 703)
@@ -253,3 +253,12 @@
     descr(session_mdl)
     self.dishDisabled = False
 
+  def printPetriDishSlot(self):
+    printer = QPrinter()
+    if printer.setup():
+      widget = QPixmap.grabWidget(self, 0, 0,
+                                  self.width(),
+                                  self.height())
+      painter = QPainter(printer)
+      painter.drawPixmap(0, 0, widget)
+      painter.end()

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyOnePopulationCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyOnePopulationCtrl.py	2006-05-23 05:04:43 UTC (rev 702)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyOnePopulationCtrl.py	2006-05-23 21:29:08 UTC (rev 703)
@@ -33,19 +33,29 @@
       PYSIGNAL("restartPopulationSig"), self.restartPopulationSlot)
 
   def aboutToBeLowered(self):
-    """Disconnects "Print Graph..." menu item from One-Pop Graph controller."""
+    """Disconnects "Print..." menu items from One-Pop Graph controller."""
     descr()
     self.disconnect(
       self.m_session_mdl.m_session_mdtr,
       PYSIGNAL("printGraphSig"),
       self.m_one_pop_graph_ctrl.printGraphSlot)
+    self.disconnect(
+      self.m_session_mdl.m_session_mdtr,
+      PYSIGNAL("printPetriDishSig"),
+#      self.m_one_pop_petri_dish_ctrl.m_petri_dish_ctrl.printPetriDishSlot)
+      self.m_one_pop_petri_dish_ctrl.printPetriDishSlot)
   def aboutToBeRaised(self):
-    """Connects "Print Graph..." menu item to One-Pop Graph controller."""
+    """Connects "Print..." menu items to One-Pop Graph controller."""
     descr()
     self.connect(
       self.m_session_mdl.m_session_mdtr,
       PYSIGNAL("printGraphSig"),
       self.m_one_pop_graph_ctrl.printGraphSlot)
+    self.connect(
+      self.m_session_mdl.m_session_mdtr,
+      PYSIGNAL("printPetriDishSig"),
+#      self.m_one_pop_petri_dish_ctrl.m_petri_dish_ctrl.printPetriDishSlot)
+      self.m_one_pop_petri_dish_ctrl.printPetriDishSlot)
 
   def dragEnterEvent( self, e ):
     descr(e)

Modified: branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py	2006-05-23 05:04:43 UTC (rev 702)
+++ branches/developers/avida-edward/source/python/AvidaGui2/pyPetriDishCtrl.py	2006-05-23 21:29:08 UTC (rev 703)
@@ -101,6 +101,14 @@
     self.m_org_clicked_on_item = None
     self.m_occupied_cells_ids = []
 
+  def printPetriDishSlot(self):
+    printer = QPrinter()
+    if printer.setup():
+      painter = QPainter(printer)
+      self.m_canvas.drawArea(QRect(0, 0, self.m_canvas.width(),
+                                   self.m_canvas.height()), painter, False)
+      painter.end()
+
   def setColorLookupFunctor(self, color_lookup_functor):
     self.m_color_lookup_functor = color_lookup_functor
 

Modified: branches/developers/avida-edward/source/python/AvidaGui2/to-do_list
===================================================================
--- branches/developers/avida-edward/source/python/AvidaGui2/to-do_list	2006-05-23 05:04:43 UTC (rev 702)
+++ branches/developers/avida-edward/source/python/AvidaGui2/to-do_list	2006-05-23 21:29:08 UTC (rev 703)
@@ -99,9 +99,9 @@
 
 ************Josh*******************
 
-16-Jan-06 Get Windows version working -- Medium to High Priority (depdnding the needs for this ations.term)
-
 29-Apr-06 Export Excel style (tab delimited) files
+  - Change .csv to .txt extension
+  - Allow exporting in Petri Dish view
 
 
 ************Other*****************
@@ -145,3 +145,8 @@
 
 * 30-Jan-06 first step for Windows is that if python is installed,
 Avida-Ed can be downloaded and run -- Finished 24-Feb-06
+
+
+************Josh*******************
+
+16-Jan-06 Get Windows version working -- Finished 21-Feb-06

Modified: branches/developers/avida-edward/source/python/scripts/win32/setup.py
===================================================================
--- branches/developers/avida-edward/source/python/scripts/win32/setup.py	2006-05-23 05:04:43 UTC (rev 702)
+++ branches/developers/avida-edward/source/python/scripts/win32/setup.py	2006-05-23 21:29:08 UTC (rev 703)
@@ -17,7 +17,7 @@
 }
 
 def recurse_dir(dir, filter, ltrim):
-    "Recursively return list of files in directory.  filter is a functino to filter the directories and ltrim will trim off n characters from the directory."
+    "Recursively return list of files in directory.  filter is a function to filter the directories and ltrim will trim off n characters from the directory."
     l = []
     for root, newdir, files in os.walk(dir):
         if filter(root):
@@ -28,6 +28,8 @@
                     l.append((root[ltrim:], [root + "/" + file]))
     return l
 
+ext_files = recurse_dir("../../default.workspace", lambda x: not '.svn' in x, 6)
+ext_files.append(('.', ['../../AvidaGui2/open.png', '../../AvidaGui2/closed.png', '../../AvidaGui2/avidalogo.png']))
 setup(
     version = "0.0.1",
     description = "Avida-ED Windows Executable",
@@ -35,8 +37,7 @@
 
     # targets to build
     console = ["Avida-ED.py"],
-    data_files =  recurse_dir("../../default.workspace",
-                              lambda x: not '.svn' in x, 6),
+    data_files = ext_files, 
     options = opts,
     zipfile = None
 )




More information about the Avida-cvs mailing list