Hauptseite | Klassenhierarchie | Alphabetische Liste | Übersicht | Auflistung der Dateien | Datenstruktur-Elemente | Datei-Elemente

zeitverlauf.h

gehe zur Dokumentation dieser Datei
00001 
00002 // zeitverlauf.h
00003 // LFTVideo.cpp  v1.7
00004 //               12.5.2003
00005 // 
00006 // für weitere Informationen:
00007 // siehe header von main.cpp
00008 
00009 #ifndef ZEITVERLAUF_H
00010 #define ZEITVERLAUF_H
00011 
00012 // kein Meckern wg. langer Funktionsnamen (wg. map) :
00013 #pragma warning(disable:4786) 
00014 
00015 #include <functional>   // für binary_function "less"
00016 #include <map>                  // als Container
00017 #include <iostream>             // für ostream <<
00018 #include <qstring.h>    // QString
00019 #include <qtextstream.h>// für Lese und Schreiboperationen auf Platte
00020 
00021 using std::binary_function;     
00022 using std::less;
00023 using std::map;
00024 using std::ostream;
00025 
00026 
00027 // enum RatingSkala
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 // helpers
00043 QString leadingZero(int n);
00044 QString leading2Zeros(int n);
00045 double nachkomma (double zahl);
00046 double runden (double zahl);
00047 
00048 
00049 // class MinSec
00051 // Speichert (Minuten, Sekunden)
00052 // incl Vergleichen, Umrechnungen, ...
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;                          // konvertiere komplett in Sekunden
00064         double secsTo(const MinSec &rhs) const;  // Abstand in Sekunden
00065         MinSec addSecs (double s) const;   // liefert MinSec mit s Sekunden später
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         // alt: friend double operator -(const MinSec& x, const MinSec& y);
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 // struct IntervallErgebnis
00083 // Container für (Rating, RatingDavor, Dauer)
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 // map MinSec2Rating
00101 // Container für (Endzeitpunkt, Rating)
00102 
00103 typedef map < MinSec, RatingSkala, MinSec::less >  MinSec2Rating;
00104 void testMinSecMap();
00105 
00106 
00107 // class RatingVerlauf
00109 // Container und Memberfunktionen
00110 
00111 class RatingVerlauf {
00112 public:
00113         RatingVerlauf();
00114         ~RatingVerlauf();
00115 
00116         MinSec2Rating Sinneinheiten;
00117 
00118 public:
00119         void testRatingVerlauf();
00120         // Schreiboperationen
00121         void RatingLoeschen(const MinSec &Endmoment);
00122         void RatingAnhaengen(const MinSec &Endmoment, 
00123                                                  const RatingSkala Einschaetzung);
00124         // Leseoperationen:
00125         MinSec BisherLetzterMoment();
00126         // liefere alle 3 Daten auf einmal als struct:
00127         IntervallErgebnis RatingAuslesen (const MinSec &Endmoment);
00128         IntervallErgebnis RatingAuslesen (MinSec2Rating::iterator it);
00129         // print Ausgabeoperationen:
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         // bool speichereGesamtenRatingVerlauf(QString filename);
00136 
00137         int verkuerzeUmAufeinanderfolgendGleiche();
00138 };
00139 
00140 //struct AnzahlDauer {int Anzahl, QTime Dauer}
00141         //      Summation (const EinschaetzungsSkala &Einschaetzung);
00142 
00143 #endif ZEITVERLAUF_H

Erzeugt am Mon Jun 16 18:08:24 2003 für LFTVideo von doxygen 1.3.2