Changeset f0964c
- Timestamp:
- Oct 14, 2013, 11:41:38 PM (11 years ago)
- 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:
- b677ab
- Parents:
- 4b2e05
- git-author:
- Frederik Heber <heber@…> (09/07/13 15:10:08)
- git-committer:
- Frederik Heber <heber@…> (10/14/13 23:41:38)
- Location:
- src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Potentials/PotentialRegistry.cpp
r4b2e05 rf0964c 40 40 #include "CodePatterns/Registry_impl.hpp" 41 41 42 PotentialRegistry::PotentialRegistry() : 43 Observable("PotentialRegistry") 44 {} 45 46 47 void PotentialRegistry::registerInstance(EmpiricalPotential *potential) 48 { 49 OBSERVE; 50 Registry<EmpiricalPotential>::registerInstance(potential); 51 } 52 void PotentialRegistry::unregisterInstance(EmpiricalPotential *potential) 53 { 54 OBSERVE; 55 Registry<EmpiricalPotential>::unregisterInstance(potential); 56 } 57 42 58 CONSTRUCT_SINGLETON(PotentialRegistry) 43 59 CONSTRUCT_REGISTRY(EmpiricalPotential) -
src/Potentials/PotentialRegistry.hpp
r4b2e05 rf0964c 14 14 #endif 15 15 16 #include "CodePatterns/Observer/Observable.hpp" 16 17 #include "CodePatterns/Registry.hpp" 17 18 #include "CodePatterns/Singleton.hpp" … … 29 30 * ones. 30 31 */ 31 class PotentialRegistry : public Singleton<PotentialRegistry>, public Registry<EmpiricalPotential> 32 class PotentialRegistry : 33 public Singleton<PotentialRegistry>, 34 public Registry<EmpiricalPotential>, 35 public Observable 32 36 { 33 37 friend class Singleton<PotentialRegistry>; … … 36 40 public: 37 41 42 void registerInstance(EmpiricalPotential*); 43 void unregisterInstance(EmpiricalPotential*); 44 38 45 private: 39 PotentialRegistry() {}40 ~PotentialRegistry() {}46 PotentialRegistry(); 47 virtual ~PotentialRegistry() {} 41 48 }; 42 49 -
src/UIElements/Views/Qt4/QtHomologyList.cpp
r4b2e05 rf0964c 45 45 46 46 #include "Fragmentation/Homology/HomologyContainer.hpp" 47 #include "Potentials/PotentialRegistry.hpp" 47 48 #include "World.hpp" 48 49 … … 54 55 QtHomologyList::QtHomologyList(QWidget * _parent) : 55 56 QWidget(_parent), 56 Observer("QtHomologyList") 57 Observer("QtHomologyList"), 58 potentialregistry_enabled(false) 57 59 { 58 60 QSplitter *splitter = new QSplitter (Qt::Horizontal, this ); … … 78 80 HomologyContainer &homologies = World::getInstance().getHomologies(); 79 81 homologies.signOn(this); 82 PotentialRegistry::getInstance().signOn(this); 83 potentialregistry_enabled = true; 80 84 81 85 connect(treewidget,SIGNAL(itemSelectionChanged()),this,SLOT(rowSelected())); … … 87 91 HomologyContainer &homologies = World::getInstance().getHomologies(); 88 92 homologies.signOff(this); 93 if (potentialregistry_enabled) 94 PotentialRegistry::getInstance().signOff(this); 89 95 } 90 96 … … 150 156 { 151 157 // as a new instance should always already be present ... just sign on 152 HomologyContainer &homologies = World::getInstance().getHomologies(); 153 homologies.signOn(this); 158 if (static_cast<PotentialRegistry *>(publisher) == PotentialRegistry::getPointer()) { 159 potentialregistry_enabled = false; 160 } else { 161 // its HomologyContainer 162 } 154 163 } 155 164 -
src/UIElements/Views/Qt4/QtHomologyList.hpp
r4b2e05 rf0964c 53 53 //!> flag to indicate that we currently clear the view, avoids thread collisions 54 54 bool clearing; 55 //!> flag to indicate whether we are subscribed to PotentialRegistry 56 bool potentialregistry_enabled; 55 57 56 58 private:
Note:
See TracChangeset
for help on using the changeset viewer.