|
Last change
on this file since db6b872 was dc5413, checked in by Tillmann Crueger <crueger@…>, 16 years ago |
|
Merge branch 'FreddiesRefactoring' into StructureRefactoring
Conflicts:
molecuilder/src/Patterns/Observer.cpp
molecuilder/src/World.cpp
molecuilder/src/boundary.cpp
molecuilder/src/molecule_dynamics.cpp
molecuilder/src/unittests/AnalysisCorrelationToPointUnitTest.cpp
molecuilder/src/unittests/AnalysisCorrelationToSurfaceUnitTest.cpp
molecuilder/src/unittests/AnalysisPairCorrelationUnitTest.cpp
molecuilder/src/unittests/Makefile.am
molecuilder/src/unittests/bondgraphunittest.cpp
molecuilder/src/unittests/listofbondsunittest.cpp
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * TextStatusIndicator.cpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Feb 18, 2010
|
|---|
| 5 | * Author: crueger
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #include "TextStatusIndicator.hpp"
|
|---|
| 9 |
|
|---|
| 10 | #include <iostream>
|
|---|
| 11 |
|
|---|
| 12 | #include "Actions/Process.hpp"
|
|---|
| 13 |
|
|---|
| 14 | using namespace std;
|
|---|
| 15 |
|
|---|
| 16 | TextStatusIndicator::TextStatusIndicator()
|
|---|
| 17 | {
|
|---|
| 18 | Process::AddObserver(this);
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | TextStatusIndicator::~TextStatusIndicator()
|
|---|
| 22 | {
|
|---|
| 23 | Process::RemoveObserver(this);
|
|---|
| 24 | }
|
|---|
| 25 |
|
|---|
| 26 | void TextStatusIndicator::update(Observable *subject){
|
|---|
| 27 | Process *proc;
|
|---|
| 28 | // we are only observing Processes
|
|---|
| 29 | if((proc=dynamic_cast<Process*>(subject))){
|
|---|
| 30 | // see what kind of progress we have to display
|
|---|
| 31 | if(proc->getMaxSteps()>0){
|
|---|
| 32 | if(!proc->doesStop()){
|
|---|
| 33 | cout << "Busy (" << proc->getName() << ") ";
|
|---|
| 34 | // we can show a percentage done
|
|---|
| 35 | cout << (int)proc->getDoneRatio() << "% done" << endl;
|
|---|
| 36 | }
|
|---|
| 37 | }
|
|---|
| 38 | else{
|
|---|
| 39 | // we only show some kind of busy animation
|
|---|
| 40 | if(proc->doesStart()){
|
|---|
| 41 | cout << "Busy (" << proc->getName() << ")";
|
|---|
| 42 | }
|
|---|
| 43 | if(!proc->doesStop()){
|
|---|
| 44 | cout << ".";
|
|---|
| 45 | }
|
|---|
| 46 | else {
|
|---|
| 47 | cout << endl;
|
|---|
| 48 | }
|
|---|
| 49 | }
|
|---|
| 50 | }
|
|---|
| 51 | }
|
|---|
| 52 |
|
|---|
| 53 | void TextStatusIndicator::subjectKilled(Observable *subject){
|
|---|
| 54 |
|
|---|
| 55 | }
|
|---|
| 56 |
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.