Ignore:
Timestamp:
Feb 12, 2016, 11:15:24 PM (9 years ago)
Author:
Frederik Heber <heber@…>
Branches:
Action_Thermostats, Add_AtomRandomPerturbation, Add_FitFragmentPartialChargesAction, Add_RotateAroundBondAction, Add_SelectAtomByNameAction, Added_ParseSaveFragmentResults, AddingActions_SaveParseParticleParameters, Adding_Graph_to_ChangeBondActions, Adding_MD_integration_tests, Adding_ParticleName_to_Atom, Adding_StructOpt_integration_tests, AtomFragments, Automaking_mpqc_open, AutomationFragmentation_failures, Candidate_v1.5.4, Candidate_v1.6.0, Candidate_v1.6.1, ChangeBugEmailaddress, ChangingTestPorts, ChemicalSpaceEvaluator, CombiningParticlePotentialParsing, Combining_Subpackages, Debian_Package_split, Debian_package_split_molecuildergui_only, Disabling_MemDebug, Docu_Python_wait, EmpiricalPotential_contain_HomologyGraph, EmpiricalPotential_contain_HomologyGraph_documentation, Enable_parallel_make_install, Enhance_userguide, Enhanced_StructuralOptimization, Enhanced_StructuralOptimization_continued, Example_ManyWaysToTranslateAtom, Exclude_Hydrogens_annealWithBondGraph, FitPartialCharges_GlobalError, Fix_BoundInBox_CenterInBox_MoleculeActions, Fix_ChargeSampling_PBC, Fix_ChronosMutex, Fix_FitPartialCharges, Fix_FitPotential_needs_atomicnumbers, Fix_ForceAnnealing, Fix_IndependentFragmentGrids, Fix_ParseParticles, Fix_ParseParticles_split_forward_backward_Actions, Fix_PopActions, Fix_QtFragmentList_sorted_selection, Fix_Restrictedkeyset_FragmentMolecule, Fix_StatusMsg, Fix_StepWorldTime_single_argument, Fix_Verbose_Codepatterns, Fix_fitting_potentials, Fixes, ForceAnnealing_goodresults, ForceAnnealing_oldresults, ForceAnnealing_tocheck, ForceAnnealing_with_BondGraph, ForceAnnealing_with_BondGraph_continued, ForceAnnealing_with_BondGraph_continued_betteresults, ForceAnnealing_with_BondGraph_contraction-expansion, FragmentAction_writes_AtomFragments, FragmentMolecule_checks_bonddegrees, GeometryObjects, Gui_Fixes, Gui_displays_atomic_force_velocity, ImplicitCharges, IndependentFragmentGrids, IndependentFragmentGrids_IndividualZeroInstances, IndependentFragmentGrids_IntegrationTest, IndependentFragmentGrids_Sole_NN_Calculation, JobMarket_RobustOnKillsSegFaults, JobMarket_StableWorkerPool, JobMarket_unresolvable_hostname_fix, MoreRobust_FragmentAutomation, ODR_violation_mpqc_open, PartialCharges_OrthogonalSummation, PdbParser_setsAtomName, PythonUI_with_named_parameters, QtGui_reactivate_TimeChanged_changes, Recreated_GuiChecks, Rewrite_FitPartialCharges, RotateToPrincipalAxisSystem_UndoRedo, SaturateAtoms_findBestMatching, SaturateAtoms_singleDegree, StoppableMakroAction, Subpackage_CodePatterns, Subpackage_JobMarket, Subpackage_LinearAlgebra, Subpackage_levmar, Subpackage_mpqc_open, Subpackage_vmg, Switchable_LogView, ThirdParty_MPQC_rebuilt_buildsystem, TrajectoryDependenant_MaxOrder, TremoloParser_IncreasedPrecision, TremoloParser_MultipleTimesteps, TremoloParser_setsAtomName, Ubuntu_1604_changes, stable
Children:
ab628c
Parents:
90821d
git-author:
Frederik Heber <heber@…> (10/29/15 14:41:13)
git-committer:
Frederik Heber <heber@…> (02/12/16 23:15:24)
Message:

ObservedValuesContainer now stores QtObserved.. instances directly.

  • we need this as QtObservedAtom and ..Molecule must signOn() to World's instance right away. If later requests to ObservedValuesContainer::get() cause new signOn()s, then these might fail.
  • we now work with QtObserved..::ptr directly everywhere.
Location:
src/UIElements/Qt4/InstanceBoard
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer.hpp

    r90821d r68418e  
    3232class ObservedValuesContainer
    3333{
     34public:
     35
     36  //!> typedef for callback functions to be used on last SubjectKilled()
     37  typedef boost::function<void (const id _id)> onDestroy_t;
     38
    3439  /** Cstor of class ObservedValuesContainer.
    3540   *
    3641   * \param _name name used in debugging and prints
    3742   * \param _board ref to InstanceBoard
     43   * \param _onDestroy function to call when last subjectKilled() was received and
     44   *        ObservedValues are destroyed
    3845   */
    3946  ObservedValuesContainer(
    4047      const std::string _name,
    41       QtObservedInstanceBoard &_board);
     48      QtObservedInstanceBoard &_board,
     49      const onDestroy_t _onDestroy);
    4250
    4351  /** Delivers the set of Observed value for the instance identified by \a _id.
     
    4856  typename T::ptr get(const id _id);
    4957
    50   /** Returns an observed instance identified by \a _id, for deallocation.
     58  /** Used by QtObserved.. instance to note that signOn() has been called.
    5159   *
    52    * \param _id identifier of the instance
     60   * \param _id identifier of the instance who called signOn()
    5361   */
    54   void yield(const id _id);
     62  void markObservedValuesAsConnected(const id _id);
    5563
    56   ObservedValues_t getObservedValues(const id _id);
    57 
    58   void returnObservedValues(const id _id, ObservedValues_t &_observedvalues);
     64  /** Used by QtObserved.. instance to note that signOff() has been called.
     65   *
     66   * \param _id identifier of the instance who called signOff()
     67   */
     68  void markObservedValuesAsDisconnected(const id _id);
    5969
    6070  /** Inform this container that subjectKilled() was received by one of the ObservedValues.
    6171   *
    6272   * \param _id identifier of the receiving instance
    63    * \param _onDestroy function to call when last subjectKilled() was received and
    64    *        ObservedValues are destroyed
    6573   */
    66   void countsubjectKilled(
    67       const id _id,
    68       boost::function<void (const id _id)> _onDestroy);
     74  void countsubjectKilled(const id _id);
     75
     76  /** Erases a vector of observed values of an instance  identified by \a _id.
     77   *
     78   * \param _id identifier of instance
     79   */
     80  void removeObservedValues(const id _id);
    6981
    7082private:
    71   typedef std::pair<ObservedValues_t, size_t> RefCountedObservedValues_t;
     83  typedef std::pair<typename T::ptr, size_t> RefCountedObservedValues_t;
    7284  typedef std::map<id, RefCountedObservedValues_t> CountedObservedValues_t;
    7385  //!> internal vector of observed values
     
    8698  QtObservedInstanceBoard &board;
    8799
     100  //!> callback function when ObservedValues need to be destroyed
     101  const onDestroy_t onDestroy;
     102
     103private:
     104  /** Internal function to check whether an Observed instance identified by
     105   * \a _id is still signOn() to its associated World instance.
     106   *
     107   * \param _id identifier of instance
     108   * \return true - no more signOn()s, false - else
     109   */
     110  bool checkRefCount(const id _id) const;
     111
     112  /** Internal function to check whether any ObservedValue identified by
     113   * \a _id is still signOn() to its associated World instance.
     114   *
     115   * \param _id identifier of instance
     116   * \return true - no more signOn()s, false - else
     117   */
     118  bool checksubjectKilled(const id _id) const;
     119
    88120private:
    89121  //!> QtObservedInstanceBoard may access anything
     
    96128   * \return true - insertion successful, false - else
    97129   */
    98   bool insert(const id _id, ObservedValues_t &_obsvalues);
     130  bool insert(const id _id, const typename T::ptr &_obsvalues);
    99131
    100132  /** Use to change the identifier associated with a vector of observed values.
     
    113145  size_t getRefCount(const id _id) const;
    114146
    115   /** Erases a vector of observed values of an instance  identified by \a _id.
    116    *
    117    * \param _id identifier of instance
    118    * \return true - erase successful, false - else
    119    */
    120   bool erase(const id _id);
    121 
    122147  /** Checks whether a vector of observed values of an instance  identified by \a _id
    123148   * is present.
  • src/UIElements/Qt4/InstanceBoard/ObservedValuesContainer_impl.hpp

    r90821d r68418e  
    2222ObservedValuesContainer<T,id>::ObservedValuesContainer(
    2323    const std::string _name,
    24     QtObservedInstanceBoard &_board) :
     24    QtObservedInstanceBoard &_board,
     25    const onDestroy_t _onDestroy) :
    2526  NameOfType(_name),
    26   board(_board)
     27  board(_board),
     28  onDestroy(_onDestroy)
    2729{}
    2830
     
    3436      "ObservedValuesContainer::getObservedValues() - no observed values present for "
    3537      +NameOfType+" "+toString(_id));
    36   const ObservedValues_t &obsvalues = iter->second.first;
    37   // increase refcount
    38   ++(iter->second.second);
    39   typename T::ptr _molecule(new T(obsvalues, board));
     38  const typename T::ptr &obsvalues = iter->second.first;
    4039
    41   return _molecule;
     40  return obsvalues;
    4241}
    4342
    4443template <class T, typename id>
    45 void ObservedValuesContainer<T,id>::yield(const id _id)
     44void ObservedValuesContainer<T,id>::markObservedValuesAsConnected(
     45    const id _id)
    4646{
    4747  typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id);
    48   ASSERT( iter != ObservedValues.end(),
    49       "ObservedValuesContainer::returnObservedAtom() - no observed values present for "
    50       +NameOfType+" "+toString(_id));
    51   ASSERT( iter->second.second != 0,
    52       "ObservedValuesContainer::returnObservedAtom() - all instances for "
    53       +NameOfType+" "+toString(_id)+" have already been returned.");
    54   // decrease refcount
    55   --(iter->second.second);
    56   if (iter->second.second == 0) {
    57     // free instance
    58   }
     48  ASSERT (iter != ObservedValues.end(),
     49      "ObservedValuesContainer<T,id>::markObservedValuesAsConnected() - Observed value of "
     50      +NameOfType+" "+toString(_id)+" is not present yet.");
     51  ++(iter->second.second);
    5952}
    6053
    6154template <class T, typename id>
    62 ObservedValues_t ObservedValuesContainer<T,id>::getObservedValues(const id _id)
     55bool ObservedValuesContainer<T,id>::checkRefCount(
     56    const id _id) const
    6357{
    64   ObservedValues_t returnvalues;
    65   typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id);
    66   ASSERT(iter != ObservedValues.end(),
    67       "ObservedValuesContainer::getObservedValues() - "+NameOfType
    68       +" values not present for id "+toString(_id));
    69   if (iter->first == _id) {
    70     returnvalues = iter->second.first;
    71     ObservedValues.erase(iter);
    72   }
    73   return returnvalues;
     58  typename CountedObservedValues_t::const_iterator iter = ObservedValues.find(_id);
     59  return ((iter != ObservedValues.end()) && (iter->second.second == 0));
    7460}
    7561
    7662template <class T, typename id>
    77 void ObservedValuesContainer<T,id>::returnObservedValues(
    78     const id _id,
    79     ObservedValues_t &_observedvalues)
     63void ObservedValuesContainer<T,id>::markObservedValuesAsDisconnected(
     64    const id _id)
    8065{
    81 #ifndef NDEBUG
    82   std::pair<typename CountedObservedValues_t::iterator, bool> inserter =
    83 #endif
    84       ObservedValues.insert(
    85           std::make_pair( _id, std::make_pair(_observedvalues,0) ) );
    86   ASSERT( inserter.second,
    87       "QtObservedInstanceBoard::returnAtomObservedValues() - could not insert ObservedValues for"
    88       +toString(_id)+".");
     66  typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id);
     67  ASSERT (iter != ObservedValues.end(),
     68      "ObservedValuesContainer<T,id>::markObservedValuesAsDisconnected() - Observed value of "
     69      +NameOfType+" "+toString(_id)+" is not present yet.");
     70  ASSERT (iter->second.second != 0,
     71      "ObservedValuesContainer<T,id>::markObservedValuesAsDisconnected() - Observed value of "
     72      +NameOfType+" "+toString(_id)+" is already signOff() from all.");
     73  --(iter->second.second);
     74
     75  if (checkRefCount(_id) && checksubjectKilled(_id))
     76    removeObservedValues(_id);
    8977}
    9078
    9179template <class T, typename id>
    92 void ObservedValuesContainer<T,id>::countsubjectKilled(
    93     const id _id,
    94     boost::function<void (const id _id)> _onDestroy)
     80bool ObservedValuesContainer<T,id>::checksubjectKilled(
     81    const id _id) const
     82{
     83  typename subjectKilledCount_t::const_iterator iter = subjectKilledCount.find(_id);
     84  return ((iter != subjectKilledCount.end()) && (iter->second == T::MAX_ObservedTypes));
     85}
     86
     87template <class T, typename id>
     88void ObservedValuesContainer<T,id>::countsubjectKilled(const id _id)
    9589{
    9690  LOG(3, "DEBUG: ObservedValuesContainer got subjectKilled() for an observed value of "
     
    10296    iter = inserter.first;
    10397  }
     98  ASSERT (iter->second < T::MAX_ObservedTypes,
     99      "ObservedValuesContainer<T,id>::countsubjectKilled() - all subjectKilled() for "
     100      +NameOfType+" "+toString(_id)+" for each observed channel came in already.");
    104101  ++(iter->second);
    105102
    106   if (iter->second > T::MAX_ObservedTypes) {
    107     ASSERT( getRefCount(_id) == 0,
    108         "ObservedValuesContainer::countsubjectKilled() - observed Values for "
    109         +NameOfType+" "+toString(_id)+" are still being held somewhere.");
    110     _onDestroy(_id);
    111     subjectKilledCount.erase(iter);
    112   }
     103  if (checkRefCount(_id) && checksubjectKilled(_id))
     104    removeObservedValues(_id);
    113105}
    114106
    115107template <class T, typename id>
    116 bool ObservedValuesContainer<T,id>::insert(const id _id, ObservedValues_t &_obsvalues)
     108void ObservedValuesContainer<T,id>::removeObservedValues(const id _id)
     109{
     110  LOG(3, "DEBUG: ObservedValuesContainer removes " << NameOfType << " " << _id);
     111  // call callback function
     112  onDestroy(_id);
     113  subjectKilledCount.erase(_id);
     114  ObservedValues.erase(_id);
     115}
     116
     117template <class T, typename id>
     118bool ObservedValuesContainer<T,id>::insert(const id _id, const typename T::ptr &_obsvalues)
    117119{
    118120  std::pair<typename CountedObservedValues_t::iterator, bool> inserter =
    119121      ObservedValues.insert(
    120122          std::make_pair( _id, std::make_pair(_obsvalues,0) ) );
     123  _obsvalues->activateObserver();
    121124  return inserter.second;
    122125}
     
    156159
    157160template <class T, typename id>
    158 bool ObservedValuesContainer<T,id>::erase(const id _id)
    159 {
    160   typename CountedObservedValues_t::iterator iter = ObservedValues.find(_id);
    161   if (iter != ObservedValues.end()) {
    162     ObservedValues.erase(iter);
    163     return true;
    164   } else
    165     return false;
    166 }
    167 
    168 template <class T, typename id>
    169161bool ObservedValuesContainer<T,id>::isPresent(const id _id) const
    170162{
  • src/UIElements/Qt4/InstanceBoard/QtObservedAtom.cpp

    r90821d r68418e  
    9494  ObservedValues(_ObservedValues)
    9595{
    96   activateObserver();
     96  // activating Observer is done by ObservedValueContainer when it's prepared
    9797}
    9898
     
    173173    owner = NULL;
    174174
    175     board.returnObservedAtom(getAtomIndex());
     175    board.markObservedAtomAsDisconnected(getAtomIndex());
    176176  }
    177177}
     
    224224    owner = NULL;
    225225    signedOffChannels = AllsignedOnChannels;
     226    board.markObservedAtomAsDisconnected(getAtomIndex());
    226227  }
    227228}
  • src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.cpp

    r90821d r68418e  
    4040
    4141#include "CodePatterns/MemDebug.hpp"
     42
     43#include <boost/bind.hpp>
    4244
    4345#include "CodePatterns/Log.hpp"
     
    5456  Observer("QtObservedInstanceBoard"),
    5557  WorldSignedOn(false),
    56   atomObservedValues("atom", *this),
    57   moleculeObservedValues("molecule", *this),
     58  atomObservedValues(
     59      "atom",
     60      *this,
     61      boost::bind(&QtObservedInstanceBoard::atomcountsubjectKilled, this, _1)),
     62  moleculeObservedValues(
     63      "molecule",
     64      *this,
     65      boost::bind(&QtObservedInstanceBoard::moleculecountsubjectKilled, this, _1)),
     66  atomSubjectKilled(
     67      boost::bind(&ObservedValuesContainer<QtObservedAtom, atomId_t>::countsubjectKilled,
     68          boost::ref(atomObservedValues),
     69          _1)),
     70  moleculeSubjectKilled(
     71      boost::bind(&ObservedValuesContainer<QtObservedMolecule, moleculeId_t>::countsubjectKilled,
     72          boost::ref(moleculeObservedValues),
     73          _1)),
    5874  lastremovedatom((atomId_t)-1),
    5975  lastremovedatomsmolecule( std::make_pair((moleculeId_t)-1,(atomId_t)-1) ),
    6076  lastremovedmolecule((moleculeId_t)-1)
    6177{
    62   boost::function<void (const atomId_t _id)> atomfctor =
    63       boost::bind(&QtObservedInstanceBoard::atomcountsubjectKilled, this, _1);
    64   atomSubjectKilled =
    65       boost::bind(&ObservedValuesContainer<QtObservedAtom, atomId_t>::countsubjectKilled,
    66           boost::ref(atomObservedValues),
    67           _1,
    68           atomfctor
    69           );
    70   boost::function<void (const moleculeId_t _id)> molfctor =
    71       boost::bind(&QtObservedInstanceBoard::moleculecountsubjectKilled, this, _1);
    72   moleculeSubjectKilled =
    73       boost::bind(&ObservedValuesContainer<QtObservedMolecule, moleculeId_t>::countsubjectKilled,
    74           boost::ref(moleculeObservedValues),
    75           _1,
    76           molfctor
    77           );
    78 
    7978  // be first (besides ObservedValues to know about new insertions)
    8079  World::getInstance().signOn(this, World::AtomInserted, GlobalObservableInfo::PriorityLevel(int(-10)));
     
    154153              _molecule,
    155154              moleculeSubjectKilled);
     155          QtObservedMolecule::ptr observedmolecule(new QtObservedMolecule(ObservedValues, *this));
    156156#ifndef NDEBUG
    157157          bool status =
    158158#endif
    159               moleculeObservedValues.insert(_id, ObservedValues);
     159              moleculeObservedValues.insert(_id, observedmolecule);
    160160          ASSERT( status,
    161               "QtObservedInstanceBoard::recieveNotification() - could not insert ObservedValues for"
     161              "QtObservedInstanceBoard::recieveNotification() - could not insert ObservedMolecule for"
    162162              +toString(_id)+".");
    163163          // we need to check for index changes
     
    201201              _atom,
    202202              atomSubjectKilled);
     203          QtObservedAtom::ptr observedatom(new QtObservedAtom(ObservedValues, *this));
    203204#ifndef NDEBUG
    204205          bool status  =
    205206#endif
    206               atomObservedValues.insert(_id, ObservedValues);
     207              atomObservedValues.insert(_id, observedatom);
    207208          ASSERT( status,
    208209              "QtObservedInstanceBoard::recieveNotification() - could not insert ObservedValues for"
     
    307308void QtObservedInstanceBoard::atomcountsubjectKilled(const atomId_t _atomid)
    308309{
    309   if (_atomid == lastremovedatomsmolecule.second)
     310  if ((_atomid == lastremovedatomsmolecule.second) && (_atomid == lastremovedatom)) {
     311    LOG(3, "DEBUG: InstanceBoard emits atomRemoved for " << _atomid);
    310312    emit atomRemoved(lastremovedatomsmolecule.first, lastremovedatomsmolecule.second);
    311   else
     313  } else
    312314    ELOG(2, "QtObservedInstanceBoard::atomcountsubjectKilled() - id " << _atomid
    313         << " not fitting with " << lastremovedatomsmolecule);
     315        << " not fitting with " << lastremovedatomsmolecule << " or " << lastremovedatom);
    314316}
    315317
    316318void QtObservedInstanceBoard::moleculecountsubjectKilled(const moleculeId_t _molid)
    317319{
    318   emit moleculeRemoved(_molid);
     320  if (lastremovedmolecule == _molid) {
     321    LOG(3, "DEBUG: InstanceBoard emits moleculeRemoved for " << _molid);
     322    emit moleculeRemoved(_molid);
     323  } else
     324    ELOG(2, "QtObservedInstanceBoard::moleculecountsubjectKilled() - id " << _molid
     325        << " not fitting with " << lastremovedmolecule);
    319326}
    320327
     
    329336}
    330337
    331 void QtObservedInstanceBoard::returnObservedAtom(const atomId_t _id)
    332 {
    333   atomObservedValues.yield(_id);
    334 }
    335 
    336 void QtObservedInstanceBoard::returnObservedMolecule(const moleculeId_t _id)
    337 {
    338   moleculeObservedValues.yield(_id);
    339 }
    340 
    341 ObservedValues_t QtObservedInstanceBoard::getAtomObservedValues(const atomId_t _id)
    342 {
    343   return atomObservedValues.getObservedValues(_id);
    344 }
    345 ObservedValues_t QtObservedInstanceBoard::getMoleculeObservedValues(const moleculeId_t _id)
    346 {
    347   return moleculeObservedValues.getObservedValues(_id);
    348 }
    349 
    350 void QtObservedInstanceBoard::returnAtomObservedValues(
    351     const atomId_t _id,
    352     ObservedValues_t &_observedvalues)
    353 {
    354   if (lastremovedatom != _id) {
    355     atomObservedValues.returnObservedValues(_id, _observedvalues);
    356   } else {
    357     lastremovedatom = (atomId_t)-1;
    358     atomObservedValues.erase(_id);
    359   }
    360 }
    361 
    362 void QtObservedInstanceBoard::returnMoleculeObservedValues(
    363     const moleculeId_t _id,
    364     ObservedValues_t &_observedvalues)
    365 {
    366   if (lastremovedmolecule != _id) {
    367     moleculeObservedValues.returnObservedValues(_id, _observedvalues);
    368   } else {
    369     lastremovedmolecule = (moleculeId_t)-1;
    370     moleculeObservedValues.erase(_id);
    371   }
    372 }
    373 
     338void QtObservedInstanceBoard::markObservedAtomAsConnected(const atomId_t _id)
     339{
     340  atomObservedValues.markObservedValuesAsConnected(_id);
     341}
     342
     343void QtObservedInstanceBoard::markObservedAtomAsDisconnected(const atomId_t _id)
     344{
     345  atomObservedValues.markObservedValuesAsDisconnected(_id);
     346}
     347
     348void QtObservedInstanceBoard::markObservedMoleculeAsConnected(const moleculeId_t _id)
     349{
     350  moleculeObservedValues.markObservedValuesAsConnected(_id);
     351}
     352
     353void QtObservedInstanceBoard::markObservedMoleculeAsDisconnected(const moleculeId_t _id)
     354{
     355  moleculeObservedValues.markObservedValuesAsDisconnected(_id);
     356}
  • src/UIElements/Qt4/InstanceBoard/QtObservedInstanceBoard.hpp

    r90821d r68418e  
    8181  QtObservedAtom::ptr getObservedAtom(const atomId_t _id);
    8282  QtObservedMolecule::ptr getObservedMolecule(const moleculeId_t _id);
    83   void returnObservedAtom(const atomId_t _id);
    84   void returnObservedMolecule(const moleculeId_t _id);
    85 
    86   ObservedValues_t getAtomObservedValues(const atomId_t _id);
    87   ObservedValues_t getMoleculeObservedValues(const moleculeId_t _id);
    88 
    89   void returnAtomObservedValues(const atomId_t _id, ObservedValues_t &_observedvalues);
    90   void returnMoleculeObservedValues(const moleculeId_t _id, ObservedValues_t &_observedvalues);
     83  void markObservedAtomAsConnected(const atomId_t _id);
     84  void markObservedAtomAsDisconnected(const atomId_t _id);
     85  void markObservedMoleculeAsConnected(const moleculeId_t _id);
     86  void markObservedMoleculeAsDisconnected(const moleculeId_t _id);
    9187
    9288signals:
  • src/UIElements/Qt4/InstanceBoard/QtObservedMolecule.cpp

    r90821d r68418e  
    8484  ObservedValues(_ObservedValues)
    8585{
    86   activateObserver();
     86  // activating Observer is done by ObservedValueContainer when it's prepared
    8787}
    8888
     
    101101    owner = NULL;
    102102    signedOffChannels = AllsignedOnChannels;
     103    board.markObservedMoleculeAsDisconnected(getMolIndex());
    103104  }
    104105}
     
    132133    owner = NULL;
    133134
    134     board.returnObservedMolecule(getMolIndex());
     135    board.markObservedMoleculeAsDisconnected(getMolIndex());
    135136  }
    136137}
Note: See TracChangeset for help on using the changeset viewer.