NeoPZ
TPZGuiInterface.cpp
Go to the documentation of this file.
1 
5 //$Id: TPZGuiInterface.cpp,v 1.3 2010-07-23 04:54:25 phil Exp $
6 
7 #include "TPZGuiInterface.h"
8 #include "pzerror.h"
9 #include "TPZStream.h"
10 #include "Hash/TPZHash.h"
11 
13  this->fCanceled = false;
14  //this->fMessage = "";
15  this->fProgressBarPos = 0;
16  this->fProgressBarMaxPos = 0;
17  this->fProgressBarMinPos = 0;
18 }
19 
21  //nothing to be done
22 }
23 
25  return Hash("TPZGuiInterface");
26 }
27 
28 void TPZGuiInterface::Read(TPZStream& buf, void* context) {
29  buf.Read(fCanceled);
30  buf.Read(&fMessage);
31  buf.Read(&fProgressBarPos);
34 }
35 
36 void TPZGuiInterface::Write(TPZStream& buf, int withclassid) const {
37  buf.Write(fCanceled);
38  buf.Write(&fMessage);
39  buf.Write(&fProgressBarPos);
42 }
43 
45  if(fMessage.length())
46  {
47  std::cout << fMessage.c_str() << "\n";
48  }
49  std::cout << "Progress bar = " << fProgressBarPos << "/" << fProgressBarMaxPos
50  << "\n";
51 }
52 
55  return fMessage;
56 }
57 
58 
60 void TPZGuiInterface::SetMessage(const std::string &message)
61 {
62  fMessage = message;
63 }
64 
65 
67  std::cout << "Starting execution\n";
68 }
69 
71  std::cout << "Execution finished\n";
72 }
73 
74 void TPZGuiInterface::ShowErrorMessage(std::string message){
75  PZError << message.c_str() << "\n";
76 // DebugStop();
77 }
78 
79 
81  this->fCanceled = true;
82 }
83 
84 
86  return this->fCanceled;
87 }
88 
89 
90 
virtual void Start()
virtual ~TPZGuiInterface()
Contains declaration of TPZGuiInterface class.
Defines PZError.
virtual void ShowErrorMessage(std::string message)
void SetMessage(const std::string &message)
virtual void Write(const bool val)
Definition: TPZStream.cpp:8
std::string fMessage
std::string Message()
int32_t Hash(std::string str)
Definition: TPZHash.cpp:10
virtual void End()
Contains declaration of the abstract TPZStream class. TPZStream defines the interface for saving and ...
Defines the interface for saving and reading data. Persistency.
Definition: TPZStream.h:50
void Read(TPZStream &buf, void *context) override
read objects from the stream
void Write(TPZStream &buf, int withclassid) const override
Writes this object to the TPZStream buffer. Include the classid if withclassid = true.
virtual void UpdateCaption()
int ClassId() const override
Define the class id associated with the class.
#define PZError
Defines the output device to error messages and the DebugStop() function.
Definition: pzerror.h:15
virtual void Read(bool &val)
Definition: TPZStream.cpp:91