00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef ZEITVERLAUF_H
00010 #define ZEITVERLAUF_H
00011
00012
00013 #pragma warning(disable:4786)
00014
00015 #include <functional>
00016 #include <map>
00017 #include <iostream>
00018 #include <qstring.h>
00019 #include <qtextstream.h>
00020
00021 using std::binary_function;
00022 using std::less;
00023 using std::map;
00024 using std::ostream;
00025
00026
00027
00029
00030 enum RatingSkala {error=-1, null, TL, TNL, TU, KL, KNL, KU, NIX};
00031 const QString RatingSkalaKurz[8]={"null", "TL", "TNL", "TU", "KL", "KNL", "KU", "NIX"};
00032 const QString RatingSkalaLang[8]={"null",
00033 "Therapeut lösungsfokussiert",
00034 "Therapeut nicht lösungsfokussiert",
00035 "Therapeut unklar",
00036 "Klient Lösungssprache",
00037 "Klient keine Lösungssprache",
00038 "Klient unklar",
00039 "Pause"};
00040 const int RatingSkalaMax=7;
00041
00042
00043 QString leadingZero(int n);
00044 QString leading2Zeros(int n);
00045 double nachkomma (double zahl);
00046 double runden (double zahl);
00047
00048
00049
00051
00052
00053
00054 class MinSec {
00055 private:
00056 int Min;
00057 double Sec;
00058 public:
00059 MinSec(int mins=0, double secs=0, long milliseconds=0);
00060 int mins() const {return Min;};
00061 double secs() const {return Sec;};
00062 int millisecs() const {return runden( 1000 * nachkomma(secs()) );};
00063 double toSecs() const;
00064 double secsTo(const MinSec &rhs) const;
00065 MinSec addSecs (double s) const;
00066
00067 friend bool operator <(const MinSec& x, const MinSec& y);
00068 friend bool operator ==(const MinSec& x, const MinSec& y);
00069 friend MinSec operator-(const MinSec& x, const MinSec& y);
00070
00071 struct less : public binary_function<MinSec, MinSec, bool> {};
00072
00073 bool liesVonTextStream(QTextStream &s);
00074 QString toQString() const;
00075 static void testFloorInt();
00076 static void testMinSec() ;
00077
00078 };
00079
00080
00081
00083
00084
00085 struct IntervallErgebnis {
00086 RatingSkala Einschaetzung;
00087 RatingSkala EinschaetzungDavor;
00088 double Dauer;
00089
00090 IntervallErgebnis
00091 (RatingSkala a=null, RatingSkala b=null, double c=0)
00092 : Einschaetzung (a), EinschaetzungDavor (b), Dauer(c) {};
00093
00094 QString toQString() const;
00095 friend ostream& operator<< (ostream& os, const IntervallErgebnis& rhs);
00096 };
00097
00098
00099
00101
00102
00103 typedef map < MinSec, RatingSkala, MinSec::less > MinSec2Rating;
00104 void testMinSecMap();
00105
00106
00107
00109
00110
00111 class RatingVerlauf {
00112 public:
00113 RatingVerlauf();
00114 ~RatingVerlauf();
00115
00116 MinSec2Rating Sinneinheiten;
00117
00118 public:
00119 void testRatingVerlauf();
00120
00121 void RatingLoeschen(const MinSec &Endmoment);
00122 void RatingAnhaengen(const MinSec &Endmoment,
00123 const RatingSkala Einschaetzung);
00124
00125 MinSec BisherLetzterMoment();
00126
00127 IntervallErgebnis RatingAuslesen (const MinSec &Endmoment);
00128 IntervallErgebnis RatingAuslesen (MinSec2Rating::iterator it);
00129
00130 QString printRating (const MinSec &Endmoment);
00131 QString printGesamtenRatingVerlauf (const MinSec& von, const MinSec& bis);
00132 bool liesGesamtenRatingVerlauf (QTextStream &s);
00133 bool speichereGesamtenRatingVerlauf (QTextStream &s,
00134 QString &derKlient, QString &derRater);
00135
00136
00137 int verkuerzeUmAufeinanderfolgendGleiche();
00138 };
00139
00140
00141
00142
00143 #endif ZEITVERLAUF_H