Action_Thermostats
        Add_AtomRandomPerturbation
        Add_FitFragmentPartialChargesAction
        Add_RotateAroundBondAction
        Add_SelectAtomByNameAction
        Adding_Graph_to_ChangeBondActions
        Adding_MD_integration_tests
        Adding_StructOpt_integration_tests
        Automaking_mpqc_open
        AutomationFragmentation_failures
        Candidate_v1.5.4
        Candidate_v1.6.0
        Candidate_v1.6.1
        Candidate_v1.7.0
        ChangeBugEmailaddress
        ChangingTestPorts
        ChemicalSpaceEvaluator
        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_ChargeSampling_PBC
        Fix_ChronosMutex
        Fix_FitPartialCharges
        Fix_FitPotential_needs_atomicnumbers
        Fix_ForceAnnealing
        Fix_IndependentFragmentGrids
        Fix_ParseParticles
        Fix_ParseParticles_split_forward_backward_Actions
        Fix_StatusMsg
        Fix_StepWorldTime_single_argument
        Fix_Verbose_Codepatterns
        ForceAnnealing_goodresults
        ForceAnnealing_oldresults
        ForceAnnealing_tocheck
        ForceAnnealing_with_BondGraph
        ForceAnnealing_with_BondGraph_continued
        ForceAnnealing_with_BondGraph_continued_betteresults
        ForceAnnealing_with_BondGraph_contraction-expansion
        GeometryObjects
        Gui_displays_atomic_force_velocity
        IndependentFragmentGrids_IntegrationTest
        JobMarket_RobustOnKillsSegFaults
        JobMarket_StableWorkerPool
        JobMarket_unresolvable_hostname_fix
        ODR_violation_mpqc_open
        PartialCharges_OrthogonalSummation
        PythonUI_with_named_parameters
        QtGui_reactivate_TimeChanged_changes
        Recreated_GuiChecks
        RotateToPrincipalAxisSystem_UndoRedo
        StoppableMakroAction
        Subpackage_CodePatterns
        Subpackage_JobMarket
        Subpackage_LinearAlgebra
        Subpackage_levmar
        Subpackage_mpqc_open
        Subpackage_vmg
        ThirdParty_MPQC_rebuilt_buildsystem
        TrajectoryDependenant_MaxOrder
        TremoloParser_IncreasedPrecision
        TremoloParser_MultipleTimesteps
        Ubuntu_1604_changes
        stable
      
      
      
| Line |   | 
|---|
| 1 | /*
 | 
|---|
| 2 |  * QtStatusBar.hpp
 | 
|---|
| 3 |  *
 | 
|---|
| 4 |  *  Created on: Feb 17, 2010
 | 
|---|
| 5 |  *      Author: crueger
 | 
|---|
| 6 |  */
 | 
|---|
| 7 | 
 | 
|---|
| 8 | #ifndef QTSTATUSBAR_HPP_
 | 
|---|
| 9 | #define QTSTATUSBAR_HPP_
 | 
|---|
| 10 | 
 | 
|---|
| 11 | // include config.h
 | 
|---|
| 12 | #ifdef HAVE_CONFIG_H
 | 
|---|
| 13 | #include <config.h>
 | 
|---|
| 14 | #endif
 | 
|---|
| 15 | 
 | 
|---|
| 16 | 
 | 
|---|
| 17 | #include <map>
 | 
|---|
| 18 | #include <utility>
 | 
|---|
| 19 | #include <string>
 | 
|---|
| 20 | #include <QtGui/QStatusBar>
 | 
|---|
| 21 | 
 | 
|---|
| 22 | #include "CodePatterns/Observer/Observer.hpp"
 | 
|---|
| 23 | 
 | 
|---|
| 24 | class QBoxLayout;
 | 
|---|
| 25 | class QLabel;
 | 
|---|
| 26 | class QProgressBar;
 | 
|---|
| 27 | class QTimer;
 | 
|---|
| 28 | 
 | 
|---|
| 29 | namespace MoleCuilder {
 | 
|---|
| 30 |   class ActionStatusList;
 | 
|---|
| 31 |   class Process;
 | 
|---|
| 32 | }
 | 
|---|
| 33 | 
 | 
|---|
| 34 | class QtStatusBar : public QStatusBar, public Observer
 | 
|---|
| 35 | {
 | 
|---|
| 36 |   Q_OBJECT
 | 
|---|
| 37 | 
 | 
|---|
| 38 |   struct progressIndicator{
 | 
|---|
| 39 |     progressIndicator(const std::string &name);
 | 
|---|
| 40 |     ~progressIndicator();
 | 
|---|
| 41 |     QLabel *label;
 | 
|---|
| 42 |     QProgressBar *bar;
 | 
|---|
| 43 |     QBoxLayout *layout;
 | 
|---|
| 44 |     QWidget *container;
 | 
|---|
| 45 |   };
 | 
|---|
| 46 | public:
 | 
|---|
| 47 |   QtStatusBar(QWidget *parent=0);
 | 
|---|
| 48 |   virtual ~QtStatusBar();
 | 
|---|
| 49 | 
 | 
|---|
| 50 |   void update(Observable *subject);
 | 
|---|
| 51 |   void subjectKilled(Observable *subject);
 | 
|---|
| 52 |   void recieveNotification(Observable *_publisher, Notification *_notification);
 | 
|---|
| 53 | 
 | 
|---|
| 54 | private slots:
 | 
|---|
| 55 |   void updateProgressBar(
 | 
|---|
| 56 |       const std::string name,
 | 
|---|
| 57 |       const unsigned int maxsteps,
 | 
|---|
| 58 |       const unsigned int currentstep,
 | 
|---|
| 59 |       const bool StopStatus);
 | 
|---|
| 60 |   void updateStatusMessage();
 | 
|---|
| 61 | 
 | 
|---|
| 62 | signals:
 | 
|---|
| 63 |   void redrawProgressBar(
 | 
|---|
| 64 |       const std::string name,
 | 
|---|
| 65 |       const unsigned int maxsteps,
 | 
|---|
| 66 |       const unsigned int currentstep,
 | 
|---|
| 67 |       const bool StopStatus);
 | 
|---|
| 68 | 
 | 
|---|
| 69 | private:
 | 
|---|
| 70 |   void redrawStatus();
 | 
|---|
| 71 | 
 | 
|---|
| 72 |   void startTimer();
 | 
|---|
| 73 |   void stopTimer();
 | 
|---|
| 74 | 
 | 
|---|
| 75 |   int atomCount;
 | 
|---|
| 76 |   int moleculeCount;
 | 
|---|
| 77 | 
 | 
|---|
| 78 |   QLabel *statusLabel;
 | 
|---|
| 79 |   QWidget *parent;
 | 
|---|
| 80 |   typedef std::map<std::string,progressIndicator*> progressBars_t;
 | 
|---|
| 81 |   progressBars_t progressBars;
 | 
|---|
| 82 |   std::string activeProcess;
 | 
|---|
| 83 |   //!> reference to the StatusList we are signed on
 | 
|---|
| 84 |   MoleCuilder::ActionStatusList& StatusList;
 | 
|---|
| 85 |   //!> indicates whether we are currently signed on
 | 
|---|
| 86 |   bool StatusList_signedOn;
 | 
|---|
| 87 |   //!> QTimer instance that causes regular updates of status messages
 | 
|---|
| 88 |   QTimer *timer;
 | 
|---|
| 89 |   //!> time interval in milliseconds
 | 
|---|
| 90 |   const int timer_interval;
 | 
|---|
| 91 | };
 | 
|---|
| 92 | 
 | 
|---|
| 93 | #endif /* QTSTATUSBAR_HPP_ */
 | 
|---|
       
      
  Note:
 See   
TracBrowser
 for help on using the repository browser.