[avida-cvs] avida CVS commits: /current/source/qt-viewer Makefile.am n_orig_instruction_cpu_widget.cc setup_avida.cc wizard.ui

kaben avida-cvs at alife.org
Wed Aug 27 01:15:38 PDT 2003


kaben		Tue Aug 26 17:15:38 2003 EDT

  Modified files:              
    /avida/current/source/qt-viewer	Makefile.am 
                                   	n_orig_instruction_cpu_widget.cc 
                                   	setup_avida.cc wizard.ui 
  Log:
  
  Crashbug fixes:
  - "inputs" are no longer per-cell, but per-organism; when the instruction
    viewer is focussed on an empty cell, it no longer requests the inputs
    at that cell.
  - the function pointer 'fun_get_input_at', added to cPopulationInterface,
    is now initialized in setup_avida.cc.  
  
  
Index: avida/current/source/qt-viewer/Makefile.am
diff -u avida/current/source/qt-viewer/Makefile.am:1.48 avida/current/source/qt-viewer/Makefile.am:1.49
--- avida/current/source/qt-viewer/Makefile.am:1.48	Fri May 30 14:40:16 2003
+++ avida/current/source/qt-viewer/Makefile.am	Tue Aug 26 17:15:38 2003
@@ -5,15 +5,15 @@
 
 QMAKE_OPTIONS=
 
-if QMAKE_DEBUG
-QMAKE_OPTIONS+="CONFIG*=debug"
-endif
-
-if QMAKE_WARN
-QMAKE_OPTIONS+="CONFIG*=warn-on"
-else
-QMAKE_OPTIONS+="CONFIG*=warn-off"
-endif
+#if QMAKE_DEBUG
+#QMAKE_OPTIONS+="CONFIG*=debug"
+#endif
+#
+#if QMAKE_WARN
+#QMAKE_OPTIONS+="CONFIG*=warn-on"
+#else
+#QMAKE_OPTIONS+="CONFIG*=warn-off"
+#endif
 
 QMAKE_OPTIONS+="AT_SRCDIR=$(srcdir)"
 QMAKE_OPTIONS+="AT_BINDIR=$(bindir)"
Index: avida/current/source/qt-viewer/n_orig_instruction_cpu_widget.cc
diff -u avida/current/source/qt-viewer/n_orig_instruction_cpu_widget.cc:1.16 avida/current/source/qt-viewer/n_orig_instruction_cpu_widget.cc:1.17
--- avida/current/source/qt-viewer/n_orig_instruction_cpu_widget.cc:1.16	Tue May 20 05:07:59 2003
+++ avida/current/source/qt-viewer/n_orig_instruction_cpu_widget.cc	Tue Aug 26 17:15:38 2003
@@ -198,6 +198,9 @@
 cSummaryWidget::updateState(void){
   GenDebug("entered.");
 
+  if(!m_mission_control) return;
+  m_mission_control->lock();
+
   cPopulation *population = m_mission_control->getPopulation();
 
   cPopulationCell *population_cell =
@@ -237,7 +240,7 @@
     );
 
   // Location:
-  if(0 == population || 0 == population_cell){
+  if(!population || !population_cell){
     m_location->setData1Text("");
   } else {
     m_location->setData1Text(
@@ -251,7 +254,7 @@
 
   // Genotype ID:
   // Genotype Name:
-  if(0 == genotype){
+  if(!genotype){
     m_genotype_id->setData1Text("");
     m_genotype_name->setData1Text("");
   } else {
@@ -265,7 +268,7 @@
 
   // Faults:
   // Offspring:
-  if(0 == phenotype){
+  if(!phenotype){
     m_faults->setData1Text("");
     m_offspring->setData1Text("");
   } else {
@@ -278,7 +281,7 @@
   }
 
   // Thread:
-  if(0 == hardware){
+  if(!hardware){
     m_thread->setData1Text("");
   } else {
     m_thread->setData1Text(
@@ -289,6 +292,7 @@
       )
     );
   }
+  m_mission_control->unlock();
 }
 
 
@@ -343,6 +347,9 @@
 cRegistersWidget::updateState(void){
   GenDebug("entered.");
 
+  if(!m_mission_control) return;
+  m_mission_control->lock();
+
   cHardwareCPU *hardware =
     GetHardwareCPU(
       GetOrganism(
@@ -353,7 +360,7 @@
       )
     );
 
-  if(0 == hardware){
+  if(!hardware){
     int i = 0;
     cLabeledField *labeled_field = m_registers.first();
     for(
@@ -376,6 +383,7 @@
       labeled_field->setData2Binary(hardware->Register(i));
     }
   }
+  m_mission_control->unlock();
 }
 
 void
@@ -440,13 +448,16 @@
 cInputsWidget::updateState(void){
   GenDebug("entered.");
 
+  if(!m_mission_control) return;
+  m_mission_control->lock();
+
   cPopulationCell *pop_cell =
     GetPopulationCell(
       m_mission_control,
       m_cell_id
     );
 
-  if(0 == pop_cell){
+  if(!pop_cell || !GetOrganism(pop_cell)){
     int i = 0;
     cLabeledField *labeled_field = m_inputs.first();
     for(
@@ -469,6 +480,7 @@
       labeled_field->setData2Binary(pop_cell->GetInput(i));
     }
   }
+  m_mission_control->unlock();
 }
 
 void
@@ -591,6 +603,9 @@
 cStackField::updateState(void){
   GenDebug("entered.");
 
+  if(!m_mission_control) return;
+  m_mission_control->lock();
+
   cHardwareCPU *hardware =
     GetHardwareCPU(
       GetOrganism(
@@ -601,7 +616,7 @@
       )
     );
 
-  if(0 == hardware){
+  if(!hardware){
     GenDebug(" --- 0 == hardware");
     setData1Text("");
     setData2Text("");
@@ -622,6 +637,7 @@
       useFrame(false);
     }
   }
+  m_mission_control->unlock();
 }
 
 void
@@ -696,8 +712,11 @@
 cStackPopup::updateState(void){
   GenDebug("entered.");
 
+  if(!m_mission_control) return;
   if(!isVisible()) return;
 
+  m_mission_control->lock();
+
   cHardwareCPU *hardware =
     GetHardwareCPU(
       GetOrganism(
@@ -708,7 +727,7 @@
       )
     );
 
-  if(0 == hardware){
+  if(!hardware){
     int i = 0;
     cLabeledField *labeled_field = m_stacklines.first();
     for(
@@ -736,6 +755,7 @@
       labeled_field->setData2Binary(hardware->GetStack(i, m_stack_no));
     }
   }
+  m_mission_control->unlock();
 }
 
 void
Index: avida/current/source/qt-viewer/setup_avida.cc
diff -u avida/current/source/qt-viewer/setup_avida.cc:1.23 avida/current/source/qt-viewer/setup_avida.cc:1.24
--- avida/current/source/qt-viewer/setup_avida.cc:1.23	Fri Jun 13 14:49:59 2003
+++ avida/current/source/qt-viewer/setup_avida.cc	Tue Aug 26 17:15:38 2003
@@ -101,6 +101,7 @@
   test_interface.SetFun_Recycle(&cCallbackUtil::CB_RecycleHardware);
   test_interface.SetFun_Divide(&cCallbackUtil::CB_TestDivide);
   test_interface.SetFun_GetInput(&cCallbackUtil::CB_GetInput);
+  test_interface.SetFun_GetInputAt(&cCallbackUtil::CB_GetInputAt);
   test_interface.SetFun_GetResources(&cCallbackUtil::CB_GetResources);
   test_interface.SetFun_UpdateResources(&cCallbackUtil::CB_UpdateResources);
 
Index: avida/current/source/qt-viewer/wizard.ui
diff -u avida/current/source/qt-viewer/wizard.ui:1.9 avida/current/source/qt-viewer/wizard.ui:1.10
--- avida/current/source/qt-viewer/wizard.ui:1.9	Thu Jul 17 11:32:28 2003
+++ avida/current/source/qt-viewer/wizard.ui	Tue Aug 26 17:15:38 2003
@@ -1,4 +1,4 @@
-<!DOCTYPE UI><UI version="3.2" stdsetdef="1">
+<!DOCTYPE UI><UI version="3.1" stdsetdef="1">
 <class>SetupAssistant</class>
 <widget class="QWizard">
     <property name="name">






More information about the Avida-cvs mailing list