Changeset b375e7 for src/UIElements
- Timestamp:
- Feb 12, 2016, 11:15:03 PM (9 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:
- 4ab5dc
- Parents:
- db842b
- git-author:
- Frederik Heber <heber@…> (10/15/15 09:08:37)
- git-committer:
- Frederik Heber <heber@…> (02/12/16 23:15:03)
- Location:
- src/UIElements
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
src/UIElements/Qt4/QtUIFactory.cpp
rdb842b rb375e7 165 165 executePythonScript(scriptfile_line, scriptname); 166 166 do { 167 testlauncher_sleep(boost::posix_time::seconds(.1)); 167 app->processEvents(); 168 testlauncher_sleep(boost::posix_time::seconds(.5)); 168 169 } while (!MoleCuilder::ActionQueue::getInstance().isIdle()); 169 170 } … … 177 178 178 179 std::cout << "TESTLAUNCHER: Sleeping after script" << std::endl; 179 testlauncher_sleep(boost::posix_time::seconds(1. 5));180 testlauncher_sleep(boost::posix_time::seconds(1.)); 180 181 181 182 } while ((scriptiter != _scripts.end()) && (!testlauncher_Interrupted)); -
src/UIElements/Views/Qt4/QtToolBar.hpp
rdb842b rb375e7 24 24 #include <string> 25 25 26 #include "CodePatterns/ObservedValue.hpp" 27 #include "CodePatterns/Observer/Observable.hpp" 26 28 #include "CodePatterns/Observer/Observer.hpp" 27 29 … … 99 101 ) const; 100 102 103 void resetQueuedAction(); 104 std::string updateQueuedAction() const; 105 101 106 private: 107 //!> cached value of ActionQueue's last action name 108 ObservedValue<std::string> LastActionCalled; 109 110 //!> all channels that signal a queued action 111 static const Observable::channels_t ActionQueuedChannels; 112 102 113 //!> typedef for the action counts 103 114 typedef std::map<std::string, unsigned int> ActionCounts_t; -
src/UIElements/Views/Qt4/QtToolBar_QtFavoriteActions.cpp
rdb842b rb375e7 55 55 using namespace MoleCuilder; 56 56 57 const Observable::channels_t 58 QtToolBar::QtFavoriteActions::ActionQueuedChannels(1, ActionQueue::ActionQueued); 59 57 60 QtToolBar::QtFavoriteActions::QtFavoriteActions() : 58 61 Observer("QtFavoriteActions"), 62 LastActionCalled( 63 ActionQueue::getPointer(), 64 boost::bind(&QtToolBar::QtFavoriteActions::updateQueuedAction, boost::cref(this)), 65 "QtFavoriteActions_QueuedAction", 66 std::string(""), 67 ActionQueuedChannels), 59 68 ActionQueue_observing(false) 60 69 { … … 85 94 } 86 95 96 std::string QtToolBar::QtFavoriteActions::updateQueuedAction() const 97 { 98 const Action *lastcalledaction = 99 ActionQueue::getInstance().lastChanged<Action>(); 100 if (lastcalledaction != NULL) 101 return lastcalledaction->getName(); 102 else 103 return std::string(""); 104 } 105 106 void QtToolBar::QtFavoriteActions::resetQueuedAction() 107 { 108 const std::string name = LastActionCalled.get(); 109 if (!name.empty()) 110 ++ActionCounts[name]; 111 } 112 87 113 QtToolBar::QtFavoriteActions::~QtFavoriteActions() 88 114 { … … 115 141 { 116 142 if (dynamic_cast<ActionQueue *>(publisher) != NULL) { 117 // increment count for this action 118 const Action *lastcalledaction = 119 dynamic_cast<ActionQueue *>(publisher)->lastChanged<Action>(); 120 ++ActionCounts[lastcalledaction->getName()]; 143 resetQueuedAction(); 121 144 } else { 122 145 ASSERT(0, "QtFavoriteActions::update() - cannot get here, we are only subscribed to ActionQueue.");
Note:
See TracChangeset
for help on using the changeset viewer.